[Buildbot-devel] Accessing a Builder queue

Shaun McDonald buildbot-project at shaunmcdonald.me.uk
Fri Sep 12 20:20:46 UTC 2008


On 8 Sep 2008, at 17:48, Neil Hemingway wrote:

> This patch has saved me a chunk of work on #99 (Thanks Christian).   
> I have found a couple of issues though:
> The logic to calculate which index in the buildables list didn't  
> work for me, but I've fixed that
> There's a race condition.  Say a build is running with three  
> pending.  The user looks the builder page and decides to remove the  
> middle pending one.  By the time, the remove function tries to the  
> entry from the buildable list, the build that was running has  
> finished and the first pending one is now running, making the index  
> for the one the user wants to remove one not two.  (My test builds  
> consist of a 'ls', so they run quickly ;-)
> I think resolving (2) will require more fundamental changes to a  
> builder, in that I think the build number needs to be allocated at  
> the point where the request goes onto the pending queue, not when it  
> starts running.  Then we can refer to pending builds by their build  
> number just like actual builds (avoiding both the race condition  
> _and_ logic to work out which entry they are in the queue).  I also  
> think this change will be required to do just about anything to the  
> pending queue.
>
> Giving pending builds "real" numbers does leave the possibility that  
> build numbers stop being sequential  (Say build 123 gets created,  
> but then manually removed from the pending queue leaving 124 to  
> follow 122).  This will break any code that assumes that build  
> numbers are sequential (I believe there's somewhere in the code that  
> assumes the last run build was build.getNumber() - 1 ?). I'm not  
> sure what to do about that just yet.  An an aside, I'm also  
> developing a patch to prioritize build requests, which means that  
> they may even run out of order (1, 3, 2 etc.)
>
> I'm digging into what is involved in allocating build numbers when  
> they get queued to see what will break (and whether it can be fixed)
>

You may want allocate the build number when the build is submitted,  
and then rather than remove the build completely, just ignore the  
build when it comes to running. That way you will be able to see that  
someone has decided to ignore the build.

Shaun

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20080912/efaf287b/attachment.html>


More information about the devel mailing list