azagrebin commented on a change in pull request #13181:
URL: https://github.com/apache/flink/pull/13181#discussion_r484706282



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/SharedSlotTest.java
##########
@@ -234,6 +236,45 @@ public void testReleaseIfPhysicalSlotIsAllocated() {
                assertThat(released.isDone(), is(true));
        }
 
+       @Test
+       public void tesDuplicatedReturnLogicalSlotFails() {
+               CompletableFuture<PhysicalSlot> slotContextFuture = 
CompletableFuture
+                       .completedFuture(new TestingPhysicalSlot(RP, new 
AllocationID()));
+               AtomicInteger released = new AtomicInteger(0);
+               SharedSlot sharedSlot = SharedSlotBuilder
+                       .newBuilder()
+                       .withSlotContextFuture(slotContextFuture)
+                       .withReleaseCallback(g -> released.incrementAndGet())

Review comment:
       I think this case is already covered by 
`testReleaseEmptyDoesNotCallAllocatorReleaseBack` where `returnLogicalSlot` 
calls the callback and then next `sharedSlot.release` checks that the callback 
is not called any more. It is not exactly the same but the infinite recursion 
cannot happen and the recursive setup will be a bit complicated.




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


Reply via email to