jsancio commented on a change in pull request #10431:
URL: https://github.com/apache/kafka/pull/10431#discussion_r631543566



##########
File path: 
raft/src/main/java/org/apache/kafka/snapshot/FileRawSnapshotReader.java
##########
@@ -54,8 +54,12 @@ public Records records() {
     }
 
     @Override
-    public void close() throws IOException {
-        fileRecords.close();
+    public void close() {
+        try {
+            fileRecords.close();
+        } catch (IOException e) {
+            throw new RuntimeException(e);

Review comment:
       I am not sure. I could use some guidance here. I read the documentation 
for `KafkaStorageException`: 
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/errors/KafkaStorageException.java#L19-L30.
 It looks like Kafka uses `KafkaStorageException` if the IO is visible to the 
client.
   
   On the server (broker and controller) this code will be called async by the 
same scheduler used for deleting log segments. In that case `CoreUtils.swallow` 
is used which logs a WARN message. I think we should do the same 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.

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


Reply via email to