len548 commented on code in PR #11143:
URL: https://github.com/apache/ozone/pull/11143#discussion_r3882210579


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java:
##########
@@ -541,8 +541,13 @@ public void hsync() throws IOException {
       if (!isClosed()) {
         handleFlush(false);
       }
-    } catch (Exception e) {
-
+    } catch (IOException e) {
+      throw e;
+    } catch (InterruptedException e) {
+      Thread.currentThread().interrupt();
+      handleInterruptedException(e, false);
+    } catch (ExecutionException | RuntimeException e) {
+      handleExecutionException(e);

Review Comment:
   The motivation I added `RuntimeException` is because `CompletionException` 
was thrown in `TestBlockDataStreamOutput.hsyncPropagatesIOException()` (see 
[CI](https://github.com/len548/ozone/actions/runs/32848763169/job/97808867228#step:13:1741)).
 I handled this way but as you suggested in the other comment, replacing 
`stream.close()` with `assertThrows(IOException.class, stream::close);` handles 
this better and right way.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to