The YarnAllocator doesn't properly track containers being launched but not yet running. If it takes time to launch the containers on the NM they don't show up as numExecutorsRunning, but they are already out of the Pending list, so if the allocateResources call happens again it can think it has missing executors even when it doesn't (they just haven't been launched yet).
This was introduced by
Only updates the numRunningExecutors after NM has started it:
Thus if the NM is slow or the network is slow, it can miscount and start additional executors.