[Buildbot-devel] Lock check question

Kay Hayen kay.hayen at gmail.com
Sat Jun 21 09:32:24 UTC 2014


I am having the issue that my "heavy" slave lock in exlusive mode correctly
prevents more than one build from executing, however, more than one is
started, in fact up to the limit that I allow for the slave. The idea of
"heavy" jobs, was to make that limit tiered, that means only one heavy job,
and "n" total should run.

In order to achieve that, I came up with this code:

from buildbot.locks import SlaveLock
heavy_lock = SlaveLock("heavy")

def checkLock(builder, slave, request):
    return heavy_lock.isAvailable(slave, "exclusive")

and for builds then e.g. :

                    "/usr/bin/" + python,
                    [ "tests/" + test_case + "/" + getRunner(test_case),
"search" ],
                locks = ([] if not is_heavy else [
heavy_lock.access("exclusive") ]),
                canStartBuild = None if not is_heavy else checkLock

But that kind of API that mean to use in "checkLock" doesn't seem to exist.
I checked the "slave" object and found locks in there, which was "None", so
maybe it's wrong.

And is using canStartBuild even correct usage. It doesn't seem to get a
second chance to change its mind, does it.


PS: Updated to 0.8.9, so far smooth sailing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20140621/908e6068/attachment.html>

More information about the devel mailing list