Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/3398#discussion_r104153768
--- Diff:
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
@@ -239,10 +245,26 @@ public void
onContainersCompleted(List<ContainerStatus> list) {
@Override
public void onContainersAllocated(List<Container> containers) {
for (Container container : containers) {
- numPendingContainerRequests = Math.max(0,
numPendingContainerRequests - 1);
- LOG.info("Received new container: {} - Remaining
pending container requests: {}",
- container.getId(),
numPendingContainerRequests);
+ Priority priority = container.getPriority();
+ // Yarn api say that it may give containers more than
asked, so release the redundant ones
+ if
(!numPendingContainerRequests.containsKey(priority.getPriority()) ||
+
numPendingContainerRequests.get(priority.getPriority()) <= 0) {
+ LOG.debug("Received more than asked containers,
will release the {}, priority {}",
+ container.getId(),
priority.getPriority());
+
resourceManagerClient.releaseAssignedContainer(container.getId());
+ continue;
--- End diff --
Please don't use `continue`. Better using `if {} else {}`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---