summaryrefslogtreecommitdiff
path: root/distbuild
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-04-22 18:27:13 (GMT)
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-04-23 16:32:36 (GMT)
commit23436a1fd5151f5d643bf159187f3779f590e671 (patch)
treebfab3980aa5ef6ed59683fa9757b29f7a94d2cde /distbuild
parent29e199cef71eec9792a833334cd9aa3ae258dd9d (diff)
downloadmorph-23436a1fd5151f5d643bf159187f3779f590e671.tar.gz
InitiatorConnection: Handle _step_already_started
Diffstat (limited to 'distbuild')
-rw-r--r--distbuild/initiator_connection.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/distbuild/initiator_connection.py b/distbuild/initiator_connection.py
index 34f2bda..b3769d7 100644
--- a/distbuild/initiator_connection.py
+++ b/distbuild/initiator_connection.py
@@ -81,6 +81,9 @@ class InitiatorConnection(distbuild.StateMachine):
'idle', self._send_build_steps_message),
('idle', distbuild.BuildController, distbuild.BuildStepStarted,
'idle', self._send_build_step_started_message),
+ ('idle', distbuild.BuildController,
+ distbuild.BuildStepAlreadyStarted, 'idle',
+ self._send_build_step_already_started_message),
('idle', distbuild.BuildController, distbuild.BuildOutput,
'idle', self._send_build_output_message),
('idle', distbuild.BuildController, distbuild.BuildStepFinished,
@@ -113,7 +116,6 @@ class InitiatorConnection(distbuild.StateMachine):
self.initiator_name, str(id))
self.mainloop.queue_event(InitiatorConnection,
InitiatorDisconnect(id))
- # TODO should this clear our_ids?
self.mainloop.queue_event(self, _Close(event_source))
def _close(self, event_source, event):
@@ -183,6 +185,9 @@ class InitiatorConnection(distbuild.StateMachine):
self._log_send(msg)
def _send_build_step_started_message(self, event_source, event):
+ logging.debug('InitiatorConnection: build_step_started: '
+ 'id=%s step_name=%s worker_name=%s' %
+ (event.id, event.step_name, event.worker_name))
if event.id in self.our_ids:
msg = distbuild.message('step-started',
id=self._route_map.get_incoming_id(event.id),
@@ -191,6 +196,19 @@ class InitiatorConnection(distbuild.StateMachine):
self.jm.send(msg)
self._log_send(msg)
+ def _send_build_step_already_started_message(self, event_source, event):
+ logging.debug('InitiatorConnection: build_step_already_started: '
+ 'id=%s step_name=%s worker_name=%s' % (event.id, event.step_name,
+ event.worker_name))
+
+ if event.id in self.our_ids:
+ msg = distbuild.message('step-already-started',
+ id=self._route_map.get_incoming_id(event.id),
+ step_name=event.step_name,
+ worker_name=event.worker_name)
+ self.jm.send(msg)
+ self._log_send(msg)
+
def _send_build_output_message(self, event_source, event):
logging.debug('InitiatorConnection: build_output: '
'id=%s stdout=%s stderr=%s' %
@@ -205,6 +223,8 @@ class InitiatorConnection(distbuild.StateMachine):
self._log_send(msg)
def _send_build_step_finished_message(self, event_source, event):
+ logging.debug('heard built step finished: event.id: %s our_ids: %s'
+ % (str(event.id), str(self.our_ids)))
if event.id in self.our_ids:
msg = distbuild.message('step-finished',
id=self._route_map.get_incoming_id(event.id),