Skip to content

Commit

Permalink
Merge branch 'fastreconfig' of git://github.com/catlee/buildbot
Browse files Browse the repository at this point in the history
* 'fastreconfig' of git://github.com/catlee/buildbot:
  None is a safer initial value
  If the list of builders hasn't changed, don't call remote setBuilderList
  • Loading branch information
djmitche committed Apr 3, 2011
2 parents 30b6369 + 96dc7a8 commit 935ef16
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions master/buildbot/buildslave.py
Expand Up @@ -89,6 +89,8 @@ def __init__(self, name, password, max_builds=None,
self.missing_timer = None
self.keepalive_interval = keepalive_interval

self._old_builder_list = None

def update(self, new):
"""
Given a new BuildSlave, configure this one identically. Because
Expand Down Expand Up @@ -429,7 +431,15 @@ def _disconnected(rref):
def sendBuilderList(self):
our_builders = self.botmaster.getBuildersForSlave(self.slavename)
blist = [(b.name, b.slavebuilddir) for b in our_builders]
if blist == self._old_builder_list:
log.msg("Builder list is unchanged; not calling setBuilderList")
return defer.succeed(None)

d = self.slave.callRemote("setBuilderList", blist)
def sentBuilderList(ign):
self._old_builder_list = blist
return ign
d.addCallback(sentBuilderList)
return d

def perspective_keepalive(self):
Expand Down Expand Up @@ -579,6 +589,9 @@ class BuildSlave(AbstractBuildSlave):
def sendBuilderList(self):
d = AbstractBuildSlave.sendBuilderList(self)
def _sent(slist):
# Nothing has changed, so don't need to re-attach to everything
if not slist:
return
dl = []
for name, remote in slist.items():
# use get() since we might have changed our mind since then
Expand Down Expand Up @@ -821,6 +834,8 @@ def updateSlave(self):
def sendBuilderList(self):
d = AbstractBuildSlave.sendBuilderList(self)
def _sent(slist):
if not slist:
return
dl = []
for name, remote in slist.items():
# use get() since we might have changed our mind since then.
Expand Down

0 comments on commit 935ef16

Please sign in to comment.