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



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -613,25 +614,31 @@ protected void cleanUpInvoke() throws Exception {
                // stop all timers and threads
                tryShutdownTimerService();
 
+               Throwable suppressedThrowable = null;
                // stop all asynchronous checkpoint threads
                try {
                        cancelables.close();
                        shutdownAsyncThreads();
                } catch (Throwable t) {
-                       // catch and log the exception to not replace the 
original exception
-                       LOG.error("Could not shut down async checkpoint 
threads", t);
+                       // catch and suppress the exception to not replace the 
original exception
+                       suppressedThrowable = 
ExceptionUtils.firstOrSuppressed(t, suppressedThrowable);
                }
 
                // we must! perform this cleanup
                try {
                        cleanup();
                } catch (Throwable t) {
-                       // catch and log the exception to not replace the 
original exception
-                       LOG.error("Error during cleanup of stream task", t);
+                       // catch and suppress the exception to not replace the 
original exception
+                       suppressedThrowable = 
ExceptionUtils.firstOrSuppressed(t, suppressedThrowable);
                }
 
                // if the operators were not disposed before, do a hard dispose
-               disposeAllOperators(true);
+               try {
+                       disposeAllOperators(true);

Review comment:
       The original issue is addressed by catching errors in `cleanUpInvoke`, 
right?
   
   So the older change of suppressing in `disposalAllOperators` is no 
unnecessary. And then `logOnlyErrors` doesn't make sense.
   
   If we keep the change then I don't see any reason why this should only 
happen for one branch (as I [mentioned 
above](https://github.com/apache/flink/pull/12525#discussion_r436595491)). Then 
`logOnlyErrors`  makes no sense again.




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