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 04:07:29 UTC

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

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



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
##########
@@ -622,9 +622,11 @@ public void asyncReadEntries(int numberOfEntriesToRead, long maxSizeBytes, ReadE
 
         int numOfEntriesToRead = applyMaxSizeCap(numberOfEntriesToRead, maxSizeBytes);
 
-        PENDING_READ_OPS_UPDATER.incrementAndGet(this);
         OpReadEntry op = OpReadEntry.create(this, readPosition, numOfEntriesToRead, callback, ctx, maxPosition);
-        ledger.asyncReadEntries(op);
+        if (op.readPosition != null) {

Review comment:
       op is not recycle if op.readPosition == null
   
   By the way, could you add some unit test?




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