ambry icon indicating copy to clipboard operation
ambry copied to clipboard

NPE in IndexSegment.find method

Open lightningrob opened this issue 6 years ago • 0 comments

Seen in production:

java.lang.NullPointerException 
com.github.ambry.store.IndexSegment.find - Line 341 (IndexSegment.java) 
com.github.ambry.store.PersistentIndex.findKey - Line 579 (PersistentIndex.java) 
com.github.ambry.store.PersistentIndex.findKey - Line 542 (PersistentIndex.java) 
com.github.ambry.store.PersistentIndex.findKey - Line 527 (PersistentIndex.java) 
com.github.ambry.store.PersistentIndex.findMissingKeys - Line 852 (PersistentIndex.java) 
com.github.ambry.store.BlobStore.findMissingKeys - Line 628 (BlobStore.java) 
com.github.ambry.replication.ReplicaThread.getMissingStoreKeys - Line 587 (ReplicaThread.java) 
com.github.ambry.replication.ReplicaThread.exchangeMetadata - Line 434 (ReplicaThread.java) 
com.github.ambry.replication.ReplicaThread.replicate - Line 340 (ReplicaThread.java) 
com.github.ambry.replication.ReplicaThread.run - Line 203 (ReplicaThread.java) 
java.lang.Thread.run - Line 748 (Thread.java)

Analysis: there is a small time window in map() method where sealed variable is set to true without holding the rwLock, where it is possible for another thread to sneak in and call the find method while sealing is in progress (in which case serEntries may be null).

lightningrob avatar Jul 11 '19 19:07 lightningrob