Skip to content

Commit

Permalink
[FLINK-34434][slotmanager] Complete the returnedFuture when slot remo…
Browse files Browse the repository at this point in the history
…ved before allocation success
  • Loading branch information
KarmaGYZ committed Feb 20, 2024
1 parent 15af3e4 commit 1a494bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public CompletableFuture<Void> allocateSlot(
LOG.debug(
"The slot {} has been removed before. Ignore the future.",
allocationId);
requestFuture.complete(null);
returnedFuture.complete(null);
return null;
}
if (acknowledge != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ void testAllocateSlotFailsWithException() {
assertThat(taskManagerInfo.getAllocatedSlots()).isEmpty());
}

@Test
void testAllocationUpdatesIgnoredIfSlotRemoved() throws Exception {
testSlotAllocation(
(slotStatusSyncer, taskManagerTracker, instanceID, allocationId) -> {
taskManagerTracker.removeTaskManager(instanceID);
assertThat(taskManagerTracker.getAllocatedOrPendingSlot(allocationId))
.isEmpty();
});
}

@Test
void testFreeSlot() {
final FineGrainedTaskManagerTracker taskManagerTracker =
Expand Down

0 comments on commit 1a494bc

Please sign in to comment.