tillrohrmann commented on a change in pull request #7356:
[FLINK-10868][flink-yarn] Enforce maximum TMs failure rate in ResourceManagers
URL: https://github.com/apache/flink/pull/7356#discussion_r258479558
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java
##########
@@ -630,6 +674,29 @@ public void unRegisterInfoMessageListener(final String
address) {
}
}
+ /**
+ * Record failures in ResourceManagers. If maximum failure rate is met,
then reject all pending reject.
+ * @return whether should acquire new container/worker after the failure
+ */
+ @VisibleForTesting
+ protected boolean recordFailure() {
+ failureRater.recordFailure();
+ if (failureRater.exceedMaximumFailureRate()) {
+ rejectAllPendingSlotRequests(new
MaximumFailedTaskManagerExceedingException(
+ new RuntimeException(String.format("Maximum
number of failed workers %d in interval %s"
+ + "is detected in Resource
Manager", failureRater.getMaximumFailureRate(),
+
failureRater.getFailureInterval().toString()))));
+
+ return false;
+ }
+
+ return true;
+ }
+
+ protected void rejectAllPendingSlotRequests(Exception e) {
Review comment:
Is this method used by sub-classes? If not, then let's make it private.
----------------------------------------------------------------
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