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/12/01 09:22:12 UTC

[GitHub] [pulsar] casuallc commented on a change in pull request #12396: Fix NPE when create OpEntry

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



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java
##########
@@ -58,6 +57,11 @@ public static OpReadEntry create(ManagedCursorImpl cursor, PositionImpl readPosi
         }
         op.maxPosition = maxPosition;
         op.ctx = ctx;
+        PositionImpl position = cursor.ledger.startReadOperationOnLedger(readPositionRef, op);
+        if (position == null) {
+            return null;

Review comment:
       My point is :
   - `readEntriesComplete` or `readEntriesFailed` must be called in any case, so read event would always receive response.
   - `OpReadEntry` should be recyle in `readEntriesComplete` or `readEntriesFailed`.




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