AHeise commented on a change in pull request #16701:
URL: https://github.com/apache/flink/pull/16701#discussion_r682594076



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/sink/GlobalBatchCommitterHandler.java
##########
@@ -72,11 +58,12 @@ public void endInput() throws Exception {
             }
         }
         globalCommitter.endOfInput();
+        return Collections.emptyList();
     }
 
     @Override
     public void close() throws Exception {
-        super.close();
         globalCommitter.close();
+        super.close();

Review comment:
       You are supposed to close resources always in the opposite order of 
creation. That's also how try-with-resource and Guava's Closer work. The main 
idea is that your later resources may depend on the prior resources to finish 
properly. (Think of a transaction that flushes, so you'd close the transaction 
before the client).
   Here, it doesn't matter, but I'd still like to have it consistently correct 
in Flink.




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