diff options
Diffstat (limited to 'src/buildstream/_scheduler/scheduler.py')
-rw-r--r-- | src/buildstream/_scheduler/scheduler.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py index 15ae85e04..cf4581f00 100644 --- a/src/buildstream/_scheduler/scheduler.py +++ b/src/buildstream/_scheduler/scheduler.py @@ -459,6 +459,21 @@ class Scheduler: # def _sched(self): def real_schedule(): + + # Reset the scheduling handle before queuing any jobs. + # + # We do this right away because starting jobs can result + # in their being terminated and completed during the body + # of this function, and we want to be sure that we get + # called again in this case. + # + # This can happen if jobs are explicitly killed as a result, + # which might happen as a side effect of a crash in an + # abstracted frontend implementation handling notifications + # about jobs starting. + # + self._sched_handle = None + if not self.terminated: # @@ -467,9 +482,6 @@ class Scheduler: # self._sched_queue_jobs() - # Reset the scheduling hand - self._sched_handle = None - # # If nothing is ticking then bail out # |