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_r273413271
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutor.java
##########
@@ -305,8 +305,19 @@ public void start() throws Exception {
resourceManagerConnection.close();
}
+ List<CompletableFuture<Void>> cancelingTaskFutures = new
ArrayList<>();
for (JobManagerConnection jobManagerConnection :
jobManagerConnections.values()) {
try {
+ Iterator<Task> tasks =
taskSlotTable.getTasks(jobManagerConnection.getJobID());
+ while (tasks.hasNext()) {
+ CompletableFuture<Void> f;
+ try {
+ f =
tasks.next().cancelExecution();
Review comment:
`TaskExecutor.failTask(task.getExecutionId(), new FlinkException("The
TaskExecutor is shutting down."))` looks more suitable because cancelation
usually comes only from JM. `failTask` will also trigger cancelation.
----------------------------------------------------------------
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]
With regards,
Apache Git Services