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

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlot.java
 ##########
 @@ -274,8 +282,10 @@ public String toString() {
 
        @Override
        public void close() {
+               Preconditions.checkState(tasks.isEmpty(), "All tasks have to be 
removed before closing the slot");
 
 Review comment:
   I think the current API design is cumbersome. Before closing a `TaskSlot`, 
we now always have to make sure that all `Tasks` have completely terminated and 
are removed from the `TaskSlot`. Why can't we say that we fail all remaining 
tasks, remove them from the slot once they are terminated and complete the 
`closingFuture` once this has happened?
   
   Please also take a look at `AutoCloseableAsync`. I think it makes sense to 
let this class implement this interface.

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