rkhachatryan commented on a change in pull request #11480:
URL: https://github.com/apache/flink/pull/11480#discussion_r539647610



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/operators/DataSinkTaskTest.java
##########
@@ -276,6 +277,25 @@ public void testSortingDataSinkTask() {
                }
        }
 
+       @Test
+       public void testClosingErrorDataSinkTask() throws Exception {

Review comment:
       Though the test does check that `close` was called, it doesn't test if 
the original issues were resolved (order of `close` and `tryCleanupOnError` on 
`cancel` and `invoke`).

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java
##########
@@ -295,7 +298,9 @@ public void cancel() throws Exception {
                if (format != null) {
                        try {
                                this.format.close();
-                       } catch (Throwable t) {}
+                       } catch (Throwable t) {
+                               LOG.error("Error closing format.");

Review comment:
       I think `tryCleanupOnError` should be moved here (like it's done in 
`OutputFormatSinkFunction` for example).
   (logging then need to be adjusted: if `tryCleanupOnError` no need to log 
`close()` error, at least on ERR level).




----------------------------------------------------------------
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:
[email protected]


Reply via email to