You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "StevenLuMT (via GitHub)" <gi...@apache.org> on 2025/04/16 01:50:00 UTC

Re: [PR] Fix check read failed entry memory leak issue. [bookkeeper]

StevenLuMT commented on code in PR #4513:
URL: https://github.com/apache/bookkeeper/pull/4513#discussion_r2045850066


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java:
##########
@@ -351,6 +352,8 @@ private boolean tryReadingFaultyEntries(LedgerHandle lh, LedgerFragment ledgerFr
             lh.asyncReadEntries(entryIdToRead, entryIdToRead, (rc, ledHan, seq, ctx) -> {
                 long thisEntryId = (Long) ctx;
                 if (rc == BKException.Code.OK) {
+                    LedgerEntry entry = seq.nextElement();

Review Comment:
   I think 
   1. hasMoreElements needs to be judged.
   2. at the same time, if (rc == BKException.Code.OK) is true or not, this release needs to be added.
   3. then I suggest adding a testcase to cover it.



-- 
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@bookkeeper.apache.org

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