Skip to content

Commit

Permalink
de-duplicate new builds in try scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Dec 30, 2013
1 parent e5af737 commit 579bb08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions master/buildbot/schedulers/trysched.py
Expand Up @@ -264,11 +264,16 @@ def remote_subscribe(self, subscriber):
if not brdict:
return
builderId = brdict['builderid']
# make sure we aren't double-reporting any builds
reportedBuilds = set([])

# subscribe to any new builds..
def gotBuild(key, msg):
if msg['buildrequestid'] != self.brid or key[-1] != 'new':
return
if msg['buildid'] in reportedBuilds:
return
reportedBuilds.add(msg['buildid'])
return subscriber.callRemote('newbuild',
RemoteBuild(self.master, msg, self.builderName),
self.builderName)
Expand All @@ -280,6 +285,9 @@ def gotBuild(key, msg):
# and get any existing builds
builds = yield self.master.data.get(('buildrequest', self.brid, 'build'))
for build in builds:
if build['buildid'] in reportedBuilds:
return
reportedBuilds.add(build['buildid'])
yield subscriber.callRemote('newbuild',
RemoteBuild(self.master, build, self.builderName),
self.builderName)
Expand Down

0 comments on commit 579bb08

Please sign in to comment.