HuangZhenQiu commented on a change in pull request #7356:
[FLINK-10868][flink-yarn] Enforce maximum failed TMs in YarnResourceManager
URL: https://github.com/apache/flink/pull/7356#discussion_r251273483
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java
##########
@@ -301,12 +301,25 @@ public boolean registerSlotRequest(SlotRequest
slotRequest) throws SlotManagerEx
}
/**
- * Cancels and removes a pending slot request with the given allocation
id. If there is no such
- * pending request, then nothing is done.
- *
- * @param allocationId identifying the pending slot request
- * @return True if a pending slot request was found; otherwise false
+ * Rejects all pending slot requests.
+ * @param cause the exception caused the rejection
*/
+ public void rejectAllPendingSlotRequests(Exception cause) {
+ for (PendingSlotRequest pendingSlotRequest :
pendingSlotRequests.values()) {
+ rejectPendingSlotRequest(pendingSlotRequest, cause);
+ }
+
+ pendingSlotRequests.clear();
+ }
Review comment:
It can be checked by verifying the pendingSlotRequests. Added in test case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services