codelipenghui commented on a change in pull request #12396:
URL: https://github.com/apache/pulsar/pull/12396#discussion_r743393903



##########
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 != null) {

Review comment:
       @casuallc Is it able to add a test? I noticed here 
https://github.com/apache/pulsar/issues/11282#issuecomment-897304788 give an 
example to reproduce the issue.

##########
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 != null) {

Review comment:
       @casuallc Is it able to add a test? I noticed here 
https://github.com/apache/pulsar/issues/11282#issuecomment-897304788 give an 
example to reproduce the issue.

##########
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 != null) {

Review comment:
       @casuallc Is it able to add a test? I noticed here 
https://github.com/apache/pulsar/issues/11282#issuecomment-897304788 give an 
example to reproduce the issue.

##########
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 != null) {

Review comment:
       @casuallc Is it able to add a test? I noticed here 
https://github.com/apache/pulsar/issues/11282#issuecomment-897304788 give an 
example to reproduce the issue.




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