horizonzy commented on code in PR #4513:
URL: https://github.com/apache/bookkeeper/pull/4513#discussion_r2046222801
##########
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:
> Is it possible for seq to have multiple elements? It would be better to
check with hasMoreElements here.
Make sense.
> at the same time, if (rc == BKException.Code.OK) is true or not, this
release needs to be added.
For this case, if the `rc == BKException.Code.OK` is false, the seq will be
null, we don't need to release the seq.
--
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]