When a job completes, the
JobQueueManager removes this job from it's internal structures, which is a queue of the running jobs and waiting jobs. While the removal from the running jobs happens correctly, the removal from the waiting jobs does not happen, if the job is still in the PREP state. This was found while implementing
HADOOP-4035, as described
by Vinod here
. The change was introduced in
HADOOP-4471, which I should have caught in the review. Sorry about that !