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_r258503122
##########
File path:
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManager.java
##########
@@ -663,7 +666,10 @@ 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());
+
+ if (recordFailure()) {
+ startNewWorker(launched.profile());
+ }
Review comment:
I think we should move the logic whether we can start a new worker or not to
the `ResourceManager`. E.g. we could have the following methods in
`ResourceManager`
```
protected Collection<ResourceProfile> tryStartNewWorker(ResourceProfile
resourceProfile) {
if (failureRater.exceedMaximumFailureRate()) {
return Collections.emptyList();
}
return startNewWorker(resourceProfile);
}
protected void startNewWorkerIfNeeded(ResourceProfile resourceProfile, int
pendingSlots) {
int currentPendingSlots = pendingSlots;
while (currentPendingSlots < getNumberRequiredTaskManagerSlots()) {
final Collection<ResourceProfile> slots =
tryStartNewWorker(resourceProfile);
if (slots.isEmpty()) {
break;
}
currentPendingSlots += slots.size();
}
}
```
and then we only call `startNewWorkerIfNeeded` from here.
----------------------------------------------------------------
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