This is an automated email from the ASF dual-hosted git repository.

mapohl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 0731f4f1e122fb4e675464380300e7ffdd595d46
Author: Matthias Pohl <[email protected]>
AuthorDate: Mon Sep 16 12:09:35 2024 +0200

    [FLINK-36279][runtime] Making desired resources being calculated based on 
all available slots for the job
    
    FLINK-36014 aligned the triggering of the CreateExecutionGraph state within 
WaitingForResources and Executing state. Before that change, only 
WaitingForResources relied on this method. Relying on free slots was good 
enough because in WaitingForResources state, there are no slots allocated, yet.
    
    Using this method for Executing state now as well changes this premise 
because there are slots allocated while checking the slot availability that 
would become available after the restart. Hence, considering these slots in the 
slot availability check is good enough. This will not break the premise for the 
WaitingForResources state.
---
 .../apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java    | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 
a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java
 
b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java
index 5686c0e47ed..60c605e559f 100644
--- 
a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java
+++ 
b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java
@@ -1078,9 +1078,7 @@ public class AdaptiveScheduler
 
     @Override
     public boolean hasDesiredResources() {
-        final Collection<? extends SlotInfo> freeSlots =
-                
declarativeSlotPool.getFreeSlotTracker().getFreeSlotsInformation();
-        return hasDesiredResources(desiredResources, freeSlots);
+        return hasDesiredResources(desiredResources, 
declarativeSlotPool.getAllSlotsInformation());
     }
 
     @VisibleForTesting

Reply via email to