We have seen issues on our clusters where the current way of computing CPU usage is having float-arithmetic inaccuracies (the bug is still there in trunk)
Simple program to illustrate:
2017-04-12 05:43:24,014 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl: Not enough cpu for [container_e3295_1491978508342_0467_01_000030], Current CPU Allocation: [0.8888891], Requested CPU Allocation: [0.11111111]
There are a few places with this issue:
1. ResourceUtilization.java - set/getCPU both use float. When ContainerScheduler calls ContainersMonitor.increase/decreaseResourceUtilization, this may lead to issues.
2. AllocationBasedResourceUtilizationTracker.java - hasResourcesAvailable uses float as well for CPU computation.