[Buildbot-devel] Prioritize slaves with nextSlave not working

Jared Grubb jared.grubb at gmail.com
Fri May 9 15:45:49 UTC 2014

FWIW, here is one that I use:

    'slave_1': 100,
    'slave_2': 75,
    'slave_3': 50,

def useBestSlave(bldr, buildslaves):
    if not buildslaves:
        return None
        slaves = sorted(buildslaves, key=lambda s: SLAVE_PRIORITY.get(s.slave.slavename, 0))
        twisted_log.msg("useBestSlave: Of %d slaves, picked: %s" % (len(buildslaves), slaves[-1].slave.slavename))
        return slaves[-1]
    except Exception, e:
        twisted_log.msg("useBestSlave: got exception: %r" % (e))
        return random.choice(buildslaves)


        'name': '...',
        'factory': BuildFactory(steps),
        'builddir': builddir,
        'nextSlave':  useBestSlave,

On May 9, 2014, at 3:04, Julia S.S. <hithwen at gmail.com> wrote:

> Hi Jared,
> I'm using 0.8.8
> In case of exception i'd expect to see  at least the first logged message (which is the first line of the function): logger.msg('nextSlave called') and when i'm passing lambda _,slaves: random.choice(slaves) if slaves else None if should not hang anyway.
> I gave a try to the try/catch->log but i got same result: build pending and nothing in the log.
> Thanks anyway
> Sent with MailTrack

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

More information about the devel mailing list