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_r362821873
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java ########## @@ -146,12 +149,7 @@ public void start(SlotActions initialSlotActions) { public void stop() { started = false; timerService.stop(); - allocatedSlots - .values() - .stream() - .filter(slot -> !taskSlots.containsKey(slot.getIndex())) - .forEach(TaskSlot::close); - allocatedSlots.clear(); + Preconditions.checkState(allocatedSlots.isEmpty(), "All slots have to be freed before stopping TaskSlotTable"); Review comment: This precondition check could be moved to the beginning of this method. ---------------------------------------------------------------- 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