zhuzhurk commented on a change in pull request #16959:
URL: https://github.com/apache/flink/pull/16959#discussion_r696261993



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/DefaultDeclarativeSlotPool.java
##########
@@ -117,7 +117,7 @@ public void increaseResourceRequirementsBy(ResourceCounter 
increment) {
 
     @Override
     public void decreaseResourceRequirementsBy(ResourceCounter decrement) {
-        if (decrement.isEmpty()) {
+        if (decrement.isEmpty() || totalResourceRequirements.isEmpty()) {

Review comment:
       I guess the reason is that `decreaseResourceRequirementsBy` can be 
invoked twice on one physical slot. One in 
`DeclarativeSlotPoolBridge#releaseSlot` when stopping reserving a slot. One in 
`onReleaseTaskManager` which frees all the slots including allocated ones and 
available ones.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to