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_r368061316
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlot.java
 ##########
 @@ -273,9 +271,37 @@ public String toString() {
        }
 
        @Override
-       public void close() {
-               verifyMemoryFreed();
-               this.memoryManager.shutdown();
+       public CompletableFuture<Void> closeAsync() {
+               return closeAsync(new FlinkException("Closing the slot"));
+       }
+
+       /**
+        * Close the task slot asynchronously.
+        *
+        * <p>Slot is moved to {@link TaskSlotState#RELEASING} state and only 
once.
+        * If there are active tasks running in the slot then they are failed.
+        * The future of all tasks terminated and slot cleaned up is initiated 
only once and always returned
+        * in case of multiple attempts to close the slot.
+        *
+        * @param cause cause of closing
+        * @return future of all running task if any being done and slot 
cleaned up.
+        */
+       public CompletableFuture<Void> closeAsync(Throwable cause) {
 
 Review comment:
   I would not make this method public and instead leave it package private.

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