curcur commented on a change in pull request #12525:
URL: https://github.com/apache/flink/pull/12525#discussion_r439197491
##########
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;
Review comment:
> Maybe we can emulate it by having a collection of closeables and close
them in a loop:
>
> ```
> List<ThrowingRunnable<?>> runs = asList(cancelables::close,
this::shutdownAsyncThreads, this::cleanup, this::disposeAllOperators, ...);
> Throwable suppressedThrowable = null;
> for (ThrowingRunnable<?> run: runs) {
> try {
> run.run();
> } catch (Throwable t) {
> suppressedThrowable = ExceptionUtils.firstOrSuppressed(t,
suppressedThrowable);
> }
> }
> ```
yep, that's a good way, if we decide to suppress every exception.
I do not like the way we have so many try-catch blocks as well :-)
----------------------------------------------------------------
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]