codelipenghui commented on issue #10433:
URL: https://github.com/apache/pulsar/issues/10433#issuecomment-829019325


   @lhotari The pool here we are using is a thread-local pool, and always use 
the the same thread for a managed ledger to insert entry to the cache 
https://github.com/apache/pulsar/blob/6704f12104219611164aa2bb5bbdfc929613f1bf/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java#L188.
 Seems the entry does not have an opportunity to share with other thread.
   
   And if passed here 
https://github.com/apache/pulsar/blob/8ea4a39dc8bf6f2f23a160688bb70a80f6acfd4d/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/EntryCacheImpl.java#L112
 means the data are not null at this point, otherwise will throw NPE here. It's 
very interesting. If the entry does not insert into the cache, the cache 
eviction also can get a chance to access the entry.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to