Skip to content

Commit

Permalink
Bugfixes for try's monitoring of builds in progress
Browse files Browse the repository at this point in the history
Fixes #2007.

Simplify Status.build_started to take the BuildStatus object, rather
than trying to look it up before its pickle is written to disk.

Correctly handle bdict's returned from db.builds.getBuildsForRequest.

Correctly handle remote errors in newbuild
  • Loading branch information
djmitche committed Jul 5, 2011
1 parent cd696cf commit 3e7f1be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/process/builder.py
Expand Up @@ -499,7 +499,7 @@ def _startBuildFor(self, slavebuilder, buildrequests):
bids.append(wfd.getResult())

# let status know
self.master.status.build_started(req.id, self.name, bs.number)
self.master.status.build_started(req.id, self.name, bs)

# start the build. This will first set up the steps, then tell the
# BuildStatus that it has started, which will announce it to the world
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/status/buildrequest.py
Expand Up @@ -95,9 +95,9 @@ def getBuilds(self):
wfd = defer.waitForDeferred(
self.master.db.builds.getBuildsForRequest(self.brid))
yield wfd
buildnums = wfd.getResult()
bdicts = wfd.getResult()

buildnums.sort()
buildnums = sorted([ bdict['number'] for bdict in bdicts ])

for buildnum in buildnums:
bs = builder.getBuild(buildnum)
Expand Down
3 changes: 2 additions & 1 deletion master/buildbot/status/client.py
Expand Up @@ -132,7 +132,8 @@ def remote_subscribe(self, observer):
def send(bs):
d = observer.callRemote("newbuild",
IRemote(bs), self.b.getBuilderName())
d.addErrback(lambda err: None)
d.addErrback(twlog.err,
"while calling client-side remote_newbuild")
reactor.callLater(0, self.b.subscribe, send)

def remote_unsubscribe(self, observer):
Expand Down
8 changes: 3 additions & 5 deletions master/buildbot/status/master.py
Expand Up @@ -346,12 +346,10 @@ def buildreqs_retired(self, requests):
# r.bsid: check for completion, notify subscribers, unsubscribe
pass

def build_started(self, brid, buildername, buildnum):
def build_started(self, brid, buildername, build_status):
if brid in self._buildreq_observers:
bs = self.getBuilder(buildername).getBuild(buildnum)
if bs:
for o in self._buildreq_observers[brid]:
eventually(o, bs)
for o in self._buildreq_observers[brid]:
eventually(o, build_status)

def _buildrequest_subscribe(self, brid, observer):
self._buildreq_observers.add(brid, observer)
Expand Down

0 comments on commit 3e7f1be

Please sign in to comment.