Details
Description
If the user calls the following in series:
sc.requestExecutors(-5)
sc.killExecutor(...)
Then we might crash the ApplicationMaster. Why?
Well, if we request a negative number of additional executors, then the YarnAllocator will lower the target number of executors it is trying to achieve by 5. This might shoot the target number past 0. Then, if so, when we try to kill an executor it will fail the assertion that the target number must be >=0.