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 2022/04/10 04:27:33 UTC

[GitHub] [pulsar] horizonzy commented on a diff in pull request #5809: [Issue:5669] Fix the ledgerID not found cause NPE

horizonzy commented on code in PR #5809:
URL: https://github.com/apache/pulsar/pull/5809#discussion_r846710675


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -1790,8 +1790,13 @@ void updateCursor(ManagedCursorImpl cursor, PositionImpl newPosition) {
         }
     }
 
-    PositionImpl startReadOperationOnLedger(PositionImpl position) {
-        long ledgerId = ledgers.ceilingKey(position.getLedgerId());
+    PositionImpl startReadOperationOnLedger(PositionImpl position, OpReadEntry opReadEntry) {
+        Long ledgerId = ledgers.ceilingKey(position.getLedgerId());

Review Comment:
   The change maybe not fix npe, it will cause new npe problem.
   see this pr line_1800. if `ledgerId` is null, unbox will cause npe. And opReadEntry callback didn't put ctx, the callback process need use it, npe again. 



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