azagrebin commented on a change in pull request #10682: [FLINK-15247][Runtime] 
Wait for all slots to be free before task executor services shutdown upon 
stopping
URL: https://github.com/apache/flink/pull/10682#discussion_r368614621
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java
 ##########
 @@ -462,7 +471,7 @@ public int freeSlot(AllocationID allocationId, Throwable 
cause) throws SlotNotFo
         * @return True if the timeout is valid; otherwise false
         */
        public boolean isValidTimeout(AllocationID allocationId, UUID ticket) {
-               checkInit();
+               checkStartedOrClosing();
 
 Review comment:
   I think this would not hurt if we relax this check to `STARTED` (not 
`CREATED`) and make `RUNNING` state check part of the return value. This method 
is called after `notifyTimeout` where we can also relax it to `STARTED`. Even 
if we schedule `timerService#stop` to the main thread, `notifyTimeout` can be 
called afterwards because `timerService#stop` does not block on internal 
executor shutdown and we do not want it, I guess. If those methods are called 
afterwards, it should not be problem as they will just find that there is no 
registered callback anymore.

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


With regards,
Apache Git Services

Reply via email to