[Buildbot-devel] Expected behavior of bots when SIGHUP received?

Dan Kegel dank at kegel.com
Wed Sep 21 12:54:35 UTC 2011

master/buildbot/master.py says
    def _handleSIGHUP(self, *args):
        reactor.callLater(0, self.loadTheConfigFile)

slave/buildslave/bot.py says
    def _handleSIGHUP(self, *args):
        log.msg("Initiating shutdown because we got SIGHUP")
        return self.gracefulShutdown()

Why the asymmetry?

In general, I think processes should do an orderly shutdown on SIGTERM,
and reconfigure themselves on SIGHUP.  Buildslaves get most of
their config from the master, so perhaps the current buildslave
behavior should be moved to a SIGTERM handler, and the SIGHUP
handler force a retry of the connection to the server.

I ask because when I restart the master after a code change,
I often want to get the slaves to reconnect right away,
and a SIGHUP would be the easiest way to do that.

(Yeah, I could make them poll more often, but maybe that isn't always
an option.)
(SIGHUP is easier than starting and stopping the normal way
because my build slaves need access to the local desktop,
which I don't have when ssh'ing in remotely.)

More information about the devel mailing list