Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/4937#discussion_r148598542
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/instance/SlotPool.java ---
@@ -1006,7 +1044,13 @@ public boolean returnAllocatedSlot(Slot slot) {
Iterable<TaskManagerLocation> locationPreferences =
task.getTaskToExecute().getVertex().getPreferredLocations();
- return gateway.allocateSlot(task,
ResourceProfile.UNKNOWN, locationPreferences, timeout);
+ final AllocationID allocationID = new AllocationID();
+ CompletableFuture<SimpleSlot> slotFuture =
gateway.allocateSlot(allocationID, ResourceProfile.UNKNOWN,
locationPreferences, timeout);
+ slotFuture.exceptionally((Throwable failure) -> {
--- End diff --
I think `slotFuture.whenComplete` would better fit here.
---