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



##########
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:
       What part of the code are you mentioning? `operatorChain`?
   
   I think we agreed in the previous conversation that we want to keep this 
part and `mailboxProcessor.close()` as it is without changing the behavior, 
aren't we?
   
   Remember the put all the runnable into a list? I think we have discussed 
this problem there?
   
   




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to