zentol commented on a change in pull request #10089: [FLINK-12342][yarn] Remove
container requests in order to reduce excess containers
URL: https://github.com/apache/flink/pull/10089#discussion_r343154676
##########
File path:
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java
##########
@@ -370,45 +370,24 @@ public void onContainersCompleted(final
List<ContainerStatus> statuses) {
@Override
public void onContainersAllocated(List<Container> containers) {
runAsync(() -> {
+ log.info("Received {} containers with {} pending
container requests.", containers.size(), numPendingContainerRequests);
final Collection<AMRMClient.ContainerRequest>
pendingRequests = getPendingRequests();
final Iterator<AMRMClient.ContainerRequest>
pendingRequestsIterator = pendingRequests.iterator();
- for (Container container : containers) {
- log.info(
- "Received new container: {} - Remaining
pending container requests: {}",
- container.getId(),
- numPendingContainerRequests);
+ final int numAcceptedContainers =
Math.min(containers.size(), numPendingContainerRequests);
Review comment:
maybe add a comment that we use the minimum since the number of containers
can exceed the number of pending requests.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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