YARN-9099. GpuResourceAllocator#getReleasingGpus calculates number of GPUs in a wrong way. Contributed by Szilard Nemeth.

This commit is contained in:
Sunil G 2019-01-31 09:25:29 +05:30
parent 53729279c7
commit 71c49fa60f
1 changed files with 1 additions and 4 deletions

View File

@ -258,10 +258,7 @@ public class GpuResourceAllocator {
private synchronized long getReleasingGpus() { private synchronized long getReleasingGpus() {
long releasingGpus = 0; long releasingGpus = 0;
Iterator<Map.Entry<GpuDevice, ContainerId>> iter = usedDevices.entrySet() for (ContainerId containerId : ImmutableSet.copyOf(usedDevices.values())) {
.iterator();
while (iter.hasNext()) {
ContainerId containerId = iter.next().getValue();
Container container; Container container;
if ((container = nmContext.getContainers().get(containerId)) != null) { if ((container = nmContext.getContainers().get(containerId)) != null) {
if (container.isContainerInFinalStates()) { if (container.isContainerInFinalStates()) {