KarmaGYZ commented on a change in pull request #16959: URL: https://github.com/apache/flink/pull/16959#discussion_r695453034
########## 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: Ahh. I think I misunderstand it. > There should never be a case where we decrease the resource requirement such that the result is negative. This scenario already exists, that is why we observe multiple "Clearing resource requirements of job". The `totalResourceRequirements` will decrease each time in `onReleaseTaskManager`. If that is a bug, we should fix it. @zentol ########## 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: Ahh. I think I misunderstand it. > There should never be a case where we decrease the resource requirement such that the result is negative. This scenario already exists, that is why we observe multiple "Clearing resource requirements of job". The `totalResourceRequirements` will decrease each time in `onReleaseTaskManager`. If that is a bug, we should fix it. @zentol -- 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