Fix extreme slowness in hydra-queue-runner

If there are builds in the queue that depend on another scheduled build, then hydra-queue-runner will start the dependency first and block the dependent builds. This is implemented in findBuildDependencyInQueue. However, if there are tens of thousands of such dependent builds, since each call to findBuildDependencyInQueue may take a second or so, hydra-queue-runner will spend hours just deciding which builds not to do. Thus very little progress is made.

So now, when a build is started, we immediately check which builds are "blocked" by it (i.e. depend on it), and remove such builds from consideration.

Created by  Eelco Dolstra  on October 11, 2013
ZZYTUBG2HVWNYS5P3FHKK5L5CYN4ZVXPSUE36A27KPHOL6UPJHEAC
Change contents