You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/29 07:54:28 UTC

[GitHub] [pulsar] codelipenghui commented on issue #10433: NPE in broker: EntryImpl.getLength()

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:
users@infra.apache.org