The bug is in buildStatus_GIVENBACK and buildStatus_BUILDERFAIL -- job.status is not reset to WAITING. Replacing the manual buildqueue erasure in both methods with queueItem.reset() resolves the issue.
The bug is in buildStatus_ GIVENBACK and buildStatus_ BUILDERFAIL -- job.status is not reset to WAITING. Replacing the manual buildqueue erasure in both methods with queueItem.reset() resolves the issue.