summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2015-05-11 15:07:25 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-05-11 15:35:02 +0000
commit38b604c4d7167162fba200427c17a0d710284bb8 (patch)
treebd27d3a0a8aa8c345bbbb06827fe0d1e5b15b921
parent504861cb65f2d9442e3a73f83dc8ae4b9631f050 (diff)
downloadmorph-baserock/adamcoldrick/fix-job-cancellation.tar.gz
distbuild: Set job status to failed when sending exec-cancelbaserock/adamcoldrick/fix-job-cancellation
Currently jobs may continue running after exec-cancel is sent if exec-response takes a while to be sent back. This commit makes the job's state be set to 'failed' when exec-cancel is sent, so that the wait for exec-response doesn't matter. Change-Id: I858d9efcba38c81a912cf57aee2bdd8c02cb466b
-rw-r--r--distbuild/worker_build_scheduler.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/distbuild/worker_build_scheduler.py b/distbuild/worker_build_scheduler.py
index 24027b30..8abb31f3 100644
--- a/distbuild/worker_build_scheduler.py
+++ b/distbuild/worker_build_scheduler.py
@@ -501,6 +501,9 @@ class WorkerConnection(distbuild.StateMachine):
msg = distbuild.message('exec-cancel', id=job.id)
self._jm.send(msg)
+ # NOTE: If we wait for exec-response, another job for the same
+ # artifact could have started in the mean time.
+ job.set_state('failed')
self.mainloop.queue_event(self, _BuildCancelled())
def _disconnected(self, event_source, event):