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_r252355315
 
 

 ##########
 File path: 
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManager.java
 ##########
 @@ -663,7 +669,17 @@ public void taskTerminated(TaskMonitor.TaskTerminated 
message) {
                        assert(launched != null);
                        LOG.info("Worker {} failed with status: {}, reason: {}, 
message: {}.",
                                id, status.getState(), status.getReason(), 
status.getMessage());
-                       startNewWorker(launched.profile());
+
+                       recordFailure();
+
+                       if (shouldRejectRequests()) {
+                               rejectAllPendingSlotRequests(new 
MaximumFailedTaskManagerExceedingException(
+                                       new 
RuntimeException(String.format("Maximum number of failed workers %d in interval 
%s"
+                                                       + "is detected in 
Resource Manager", maximumFailureTaskExecutorPerInternal,
+                                               failureInterval.toString()))));
+                       } else {
+                               startNewWorker(launched.profile());
+                       }
 
 Review comment:
   This block seems to be generic enough that it should live in the base class.

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