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_r258479657
 
 

 ##########
 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:
   I would suggest to replace `e` with `cause`.

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

Reply via email to