littleorca commented on pull request #11292:
URL: https://github.com/apache/pulsar/pull/11292#issuecomment-878879720


   > > I think this won't work. When readEntriesFailed is called during 
initiate readPosition, the property readPosition was not assigned yet, and 
readEntriesFailed has a chance to call readPosition.getLedgerId(),which will 
cause another NPE.
   > > Further more, I guess the callbacks should be concerned also.
   > 
   > It's NoMoreEntriesToReadException in `startReadOperationOnLedger` right? 
So it's not running into the if branch for `readPosition.getLedgerId()`.
   > 
   > And the `callback` is also assigned before the assignment of 
`readPosition`.
   
   Seems you are right. I've tried to reorder statements in create() method and 
ended up in failure, I probably messed up some details about the failure.


-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to