summaryrefslogtreecommitdiff
path: root/distbuild
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-04-23 16:49:10 +0100
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-04-23 17:32:36 +0100
commitd56402413409a7d8a8cf337072e039b5aa381c3a (patch)
treed111457f03bb34c207f6fa514ccf3e54a207bc2a /distbuild
parent33e2ba3457d6626f24057084f54319cb29338771 (diff)
downloadmorph-d56402413409a7d8a8cf337072e039b5aa381c3a.tar.gz
WorkerConection: _handle_exec_response
The exec_response_msg also needs to be sent to a number of initiators, so we give it a list of ids not just one. The exec_response_msg will be sent to the controller once the artifacts have been cached successfully. There's no longer any need to use a route map to retrieve the id of the initiator, since this is stored with the job
Diffstat (limited to 'distbuild')
-rw-r--r--distbuild/worker_build_scheduler.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/distbuild/worker_build_scheduler.py b/distbuild/worker_build_scheduler.py
index 77dfa550..dbc0dfe4 100644
--- a/distbuild/worker_build_scheduler.py
+++ b/distbuild/worker_build_scheduler.py
@@ -398,23 +398,22 @@ class WorkerConnection(distbuild.StateMachine):
WorkerBuildOutput(new, self._job.artifact.cache_key))
def _handle_exec_response(self, msg):
- logging.debug('WC: finished building: %s' % self._artifact.name)
+ logging.debug('WC: finished building: %s' % self._job.artifact.name)
+ logging.debug('initiators that need to know: %s'
+ % self._job.initiators)
new = dict(msg)
- new['id'] = self._route_map.get_incoming_id(msg['id'])
- self._route_map.remove(msg['id'])
- self._initiator_request_map[self._initiator_id].remove(msg['id'])
+ new['ids'] = self._job.initiators
if new['exit'] != 0:
# Build failed.
- new_event = WorkerBuildFailed(new, self._artifact.cache_key)
+ new_event = WorkerBuildFailed(new, self._job.artifact.cache_key)
self.mainloop.queue_event(WorkerConnection, new_event)
- self.mainloop.queue_event(self, _JobFailed())
- self._artifact = None
- self._initiator_id = None
+ self.mainloop.queue_event(self, _BuildFailed())
else:
# Build succeeded. We have more work to do: caching the result.
- self.mainloop.queue_event(self, _JobIsFinished(new))
+ self.mainloop.queue_event(self, _BuildFinished())
+ self._exec_response_msg = new
def _request_job(self, event_source, event):
distbuild.crash_point()