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_r362836806
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTableTest.java
##########
@@ -239,7 +239,12 @@ public void testGenerateSlotReport() throws
SlotNotFoundException {
is(new SlotStatus(new SlotID(resourceId, 2),
TaskSlotUtils.DEFAULT_RESOURCE_PROFILE, null, null)),
is(new
SlotStatus(SlotID.generateDynamicSlotID(resourceId),
TaskSlotUtils.DEFAULT_RESOURCE_PROFILE, jobId, allocationId3))));
} finally {
- taskSlotTable.stop();
+ stopTable(taskSlotTable);
}
}
+
+ private static void stopTable(TaskSlotTable taskSlotTable) {
+ taskSlotTable.freeAllSlots(null).join();
+ taskSlotTable.stop();
+ }
Review comment:
This is a good example for why the current API design is not very elegant.
Stopping a `TaskSlotTable` should simply be `taskSlotTable.stop`.
----------------------------------------------------------------
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