Permalink
Browse files

Bugfixes for try's monitoring of builds in progress

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...
1 parent cd696cf commit 3e7f1be5398cc418c61153c6bdac8b99cecae732 @djmitche djmitche committed Jul 5, 2011
@@ -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
@@ -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)
@@ -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):
@@ -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)

0 comments on commit 3e7f1be

Please sign in to comment.