I think that only after the call `yarnAllocator.allocateResources()`,`yarnAllocator.getNumExecutorsFailed ` value will change. 

This is appropriate: after changing the value of `yarnAllocator.getNumExecutorsFailed `, immediately call `checkNumExecutorsFailed`