summaryrefslogtreecommitdiff
path: root/distbuild/worker_build_scheduler.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-04-10 08:08:40 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-04-14 11:19:06 +0300
commitf05022d39b530069a75fbecfd744bca66cc0ce66 (patch)
tree6b13cf44af03a1870fb730a3fa4825fc552df397 /distbuild/worker_build_scheduler.py
parent426c9ea359689103de8c0ff6a7dccc6922d78cf8 (diff)
downloadmorph-f05022d39b530069a75fbecfd744bca66cc0ce66.tar.gz
distbuild: Consistently name all maybe_ message callbacks
There are cases where a state machine handles an event but stays in the same state. A callback is registered which filters messages further before possibly taking action. There have been bugs caused by this pattern being incorrectly implemented (where the callback is expected to filter the message, but a transition takes place anyway). Hopefully a consistent naming convention will make the pattern clearer.
Diffstat (limited to 'distbuild/worker_build_scheduler.py')
-rw-r--r--distbuild/worker_build_scheduler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/distbuild/worker_build_scheduler.py b/distbuild/worker_build_scheduler.py
index 9ada07ef..f17a4cf4 100644
--- a/distbuild/worker_build_scheduler.py
+++ b/distbuild/worker_build_scheduler.py
@@ -226,7 +226,7 @@ class WorkerConnection(distbuild.StateMachine):
self._request_caching),
('caching', distbuild.HelperRouter, distbuild.HelperResult,
- 'caching', self._handle_helper_result),
+ 'caching', self._maybe_handle_helper_result),
('caching', self, _Cached, 'idle', self._request_job),
('caching', self, _JobFailed, 'idle', self._request_job),
]
@@ -374,7 +374,7 @@ class WorkerConnection(distbuild.StateMachine):
self._initiator_id = None
self._finished_msg = event.msg
- def _handle_helper_result(self, event_source, event):
+ def _maybe_handle_helper_result(self, event_source, event):
if event.msg['id'] == self._helper_id:
distbuild.crash_point()