zhuzhurk commented on a change in pull request #9860: [FLINK-14331][runtime] 
Reset vertices right after they transition to terminated states
URL: https://github.com/apache/flink/pull/9860#discussion_r333971888
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/DefaultScheduler.java
 ##########
 @@ -211,7 +215,8 @@ private Runnable restartTasks(final 
Set<ExecutionVertexVersion> executionVertexV
        }
 
        private CompletableFuture<?> cancelExecutionVertex(final 
ExecutionVertexID executionVertexId) {
-               return 
executionVertexOperations.cancel(getExecutionVertex(executionVertexId));
+               return 
executionVertexOperations.cancel(getExecutionVertex(executionVertexId))
+                       .whenComplete((Object ignored, Throwable t) -> 
executionSlotAllocator.cancel(executionVertexId));
 
 Review comment:
   We cannot get the slot assignment from ExecutionSlotAllocator in scheduler. 
   
   Maybe we should do the check in 
DefaultExecutionSlotAllocator#allocateSlotsFor(...) to ensure that the vertex 
has no prior pending slot request? 
   I think this change can also be beneficial for DefaultExecutionSlotAllocator 
so that it will not drop reference of an existing pending 
SlotExecutionVertexAssignment, which will otherwise cause slot leaks.

----------------------------------------------------------------
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

Reply via email to