Samrat002 commented on code in PR #28951:
URL: https://github.com/apache/flink/pull/28951#discussion_r3781161781


##########
flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/writer/NativeS3RecoverableFsDataOutputStream.java:
##########
@@ -307,6 +290,38 @@ public void close() throws IOException {
         }
     }
 
+    /** Aborts the multipart upload and releases local resources on the best 
effort basis. */
+    @Nullable
+    private IOException abortUploadAndReleaseResources(@Nullable IOException 
primary) {
+        IOException collected = primary;
+        if (currentOutputStream != null) {
+            try {
+                currentOutputStream.close();
+            } catch (IOException e) {
+                collected = ExceptionUtils.firstOrSuppressed(e, collected);

Review Comment:
   Yes, `firstOrSuppressed(e, null)` returns just e.
   When primary is null, it returns newException directly with no suppression. 
The pattern is retained rather than special-cased because collected is not 
always null at that point, such that subsequent exceptions are suppressed under 
the first one via the same call, so the symmetry is intentional.  



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

Reply via email to