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


With regards,
Apache Git Services

Mime
View raw message