zhuzhurk commented on a change in pull request #10255: [FLINK-14859][runtime]
Avoid leaking unassigned slots
URL: https://github.com/apache/flink/pull/10255#discussion_r348408190
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/TestExecutionSlotAllocator.java
##########
@@ -126,4 +131,13 @@ public void cancel(final ExecutionVertexID
executionVertexId) {
public CompletableFuture<Void> stop() {
return CompletableFuture.completedFuture(null);
}
+
+ @Override
+ public void returnLogicalSlot(final LogicalSlot logicalSlot) {
+ returnedSlots.add(logicalSlot);
+ }
+
+ public List<LogicalSlot> getReturnedSlots() {
+ return new ArrayList<>(returnedSlots);
Review comment:
I see. So here it means to get a snapshot of the current `returnedSlots`.
Could the method name to be more explicit for such assumption to avoid such
confusion?
----------------------------------------------------------------
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