junrao commented on code in PR #19661: URL: https://github.com/apache/kafka/pull/19661#discussion_r2080526231
########## clients/src/main/java/org/apache/kafka/common/record/FileRecords.java: ########## @@ -121,10 +122,14 @@ public void readInto(ByteBuffer buffer, int position) throws IOException { } @Override - public Records slice(int position, int size) throws IOException { + public FileRecords slice(int position, int size) { int availableBytes = availableBytes(position, size); int startPosition = this.start + position; - return new FileRecords(file, channel, startPosition, startPosition + availableBytes, true); + try { + return new FileRecords(file, channel, startPosition, startPosition + availableBytes, true); + } catch (IOException e) { + throw new UncheckedIOException(e); Review Comment: In RecordBatchIterator, we convert an IOException to a KafkaException. Should we be consistent here? -- 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