zentol commented on a change in pull request #14921:
URL: https://github.com/apache/flink/pull/14921#discussion_r576794499
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/declarative/allocator/SharedSlotTest.java
##########
@@ -166,6 +168,48 @@ public void
testReleaseForbidsSubsequentLogicalSlotAllocations() {
sharedSlot.allocateLogicalSlot();
}
+ @Test
+ public void testCanReturnLogicalSlotDuringRelease() {
+ final TestingPhysicalSlot physicalSlot =
TestingPhysicalSlot.builder().build();
+ final SharedSlot sharedSlot =
+ new SharedSlot(new SlotRequestId(), physicalSlot, false, () ->
{});
+ final LogicalSlot logicalSlot1 = sharedSlot.allocateLogicalSlot();
+ final LogicalSlot logicalSlot2 = sharedSlot.allocateLogicalSlot();
+
+ // both slots try to release the other one, simulating that the
failure of one execution due
+ // to the release also fails others
+ logicalSlot1.tryAssignPayload(
+ new TestLogicalSlotPayload(
+ cause -> {
+ if (logicalSlot2.isAlive()) {
+ logicalSlot2.releaseSlot(cause);
+ }
+ }));
+ logicalSlot2.tryAssignPayload(
+ new TestLogicalSlotPayload(
+ cause -> {
+ if (logicalSlot1.isAlive()) {
+ logicalSlot1.releaseSlot(cause);
+ }
+ }));
+
+ sharedSlot.release(new Exception("test"));
Review comment:
That the release did not fail with an exception; I'll add some assertios
to make this more explicit
----------------------------------------------------------------
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]