RocMarshal commented on code in PR #23635:
URL: https://github.com/apache/flink/pull/23635#discussion_r1426523374


##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/DeclarativeSlotPoolBridge.java:
##########
@@ -200,10 +226,45 @@ protected void onReleaseTaskManager(ResourceCounter 
previouslyFulfilledRequireme
 
     @VisibleForTesting
     void newSlotsAreAvailable(Collection<? extends PhysicalSlot> newSlots) {
+        if (!globalSlotsViewable) {
+            final Collection<RequestSlotMatchingStrategy.RequestSlotMatch> 
requestSlotMatches =
+                    requestSlotMatchingStrategy.matchRequestsAndSlots(
+                            newSlots, pendingRequests.values());
+            reserveMatchedFreeSlots(requestSlotMatches);
+            fulfillMatchedSlots(requestSlotMatches);
+            return;
+        }
+
+        receivedSlots.addAll(newSlots);
+        if (receivedSlots.size() < pendingRequests.size()) {
+            return;
+        }
         final Collection<RequestSlotMatchingStrategy.RequestSlotMatch> 
requestSlotMatches =
                 requestSlotMatchingStrategy.matchRequestsAndSlots(
                         newSlots, pendingRequests.values());
+        if (requestSlotMatches.size() == pendingRequests.size()) {
+            reserveMatchedFreeSlots(requestSlotMatches);
+            fulfillMatchedSlots(requestSlotMatches);
+        }
+        receivedSlots.clear();

Review Comment:
   Thanks @KarmaGYZ  for the comments.
   
   I'm sorry, I didn't quite understand your focus.
   Do you mean that we should clean up after matching, or should we not start 
cleaning up after matching?



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

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to