rkhachatryan commented on a change in pull request #12525:
URL: https://github.com/apache/flink/pull/12525#discussion_r441483658
##########
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:
Yes, I remember we agreed to preserve the behavior. But this behavior
can be implemented differently. And the current implementation loses the above
exception (which was logged previously).
----------------------------------------------------------------
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]