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



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -611,27 +611,21 @@ protected void cleanUpInvoke() throws Exception {
                Thread.interrupted();
 
                // stop all timers and threads
-               tryShutdownTimerService();
+               Exception suppressedException = 
suppressThrowable(this::tryShutdownTimerService, 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);
-               }
+               suppressedException = suppressThrowable(cancelables::close, 
suppressedException);
+               suppressedException = 
suppressThrowable(this::shutdownAsyncThreads, suppressedException);
 
                // 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);
-               }
+               suppressedException = suppressThrowable(this::cleanup, 
suppressedException);
 
                // if the operators were not disposed before, do a hard dispose
-               disposeAllOperators(true);
+               try {
+                       disposeAllOperators();
+               } catch (Exception t) {
+                       suppressedException = 
ExceptionUtils.firstOrSuppressed(t, suppressedException);
+               }
 
                // release the output resources. this method should never fail.
                if (operatorChain != null) {

Review comment:
       Then the question is in this case, who will be the suppressed exception?
   
   The previous behavior actually throws the exception from the block and log 
the suppressed ones.
   
   Let's quicky sync up on this?




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