YARN-9099. GpuResourceAllocator#getReleasingGpus calculates number of GPUs in a wrong way. Contributed by Szilard Nemeth.
(cherry picked from commit 71c49fa60faad2504b0411979a6e46e595b97a85)
This commit is contained in:
parent
4052b7ee60
commit
0e7060a1d5
@ -258,10 +258,7 @@ private synchronized GpuAllocation internalAssignGpus(Container container)
|
|||||||
|
|
||||||
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()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user