From 38b604c4d7167162fba200427c17a0d710284bb8 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Mon, 11 May 2015 15:07:25 +0000 Subject: distbuild: Set job status to failed when sending exec-cancel 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 --- distbuild/worker_build_scheduler.py | 3 +++ 1 file changed, 3 insertions(+) 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): -- cgit v1.2.1