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/09/02 02:39:05 UTC

[GitHub] [pulsar] casuallc commented on a change in pull request #11813: [ISSUE 11796] throw NPE when readEntry

casuallc commented on a change in pull request #11813:
URL: https://github.com/apache/pulsar/pull/11813#discussion_r700700625



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
##########
@@ -762,6 +764,9 @@ public void asyncReadEntriesOrWait(int maxEntries, long maxSizeBytes, ReadEntrie
         } else {
             OpReadEntry op = OpReadEntry.create(this, readPosition, numberOfEntriesToRead, callback,
                     ctx, maxPosition);
+            if (op.readPosition == null) {
+                return;

Review comment:
       Neet not call the method here, if `OpReadEntry` init failed, must ensure `OpReadEntry->readEntriesFailed` will be called, `callback.readEntriesFailed` will be called then.




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org