chia7712 commented on code in PR #15765: URL: https://github.com/apache/kafka/pull/15765#discussion_r1573633727
########## core/src/main/java/kafka/log/remote/RemoteLogManager.java: ########## @@ -463,7 +464,9 @@ private Optional<FileRecords.TimestampAndOffset> lookupTimestamp(RemoteLogSegmen RecordBatch batch = remoteLogInputStream.nextBatch(); if (batch == null) break; if (batch.maxTimestamp() >= timestamp && batch.lastOffset() >= startingOffset) { - for (Record record : batch) { + Iterator<Record> recordStreamingIterator = batch.streamingIterator(BufferSupplier.NO_CACHING); Review Comment: Could you please close the `recordStreamingIterator` when returning. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org