flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] azagrebin commented on a change in pull request #7757: [FLINK-11630] Triggers the termination of all running Tasks when shutting down TaskExecutor
Date Tue, 09 Apr 2019 10:07:41 GMT
azagrebin commented on a change in pull request #7757: [FLINK-11630] Triggers the termination
of all running Tasks when shutting down TaskExecutor
URL: https://github.com/apache/flink/pull/7757#discussion_r273417117
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
 ##########
 @@ -1032,13 +1035,16 @@ else if (current == ExecutionState.RUNNING) {
 								producedPartitions,
 								inputGates);
 
-						Thread cancelThread = new Thread(
-								executingThread.getThreadGroup(),
-								canceler,
-								String.format("Canceler for %s (%s).", taskNameWithSubtask, executionId));
-						cancelThread.setDaemon(true);
-						cancelThread.setUncaughtExceptionHandler(FatalExitExceptionHandler.INSTANCE);
-						cancelThread.start();
+						CompletableFuture<Void> future = CompletableFuture.runAsync(canceler,
 
 Review comment:
   Just waiting for cancelation triggering seems to be not enough because task is still running
concurrently and it will not solve the original [issue](https://issues.apache.org/jira/browse/FLINK-11631).
It looks like we have to introduce a `CompletableFuture<Void> terminationFuture` in
`Task` which can be completed when `Task.run()` exits, e.g. in `finally` block. Otherwise,
task can continue to use concurrently being freed task executor services.

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


With regards,
Apache Git Services

Mime
View raw message