diff --git a/buildstream/_scheduler/jobs/job.py b/buildstream/_scheduler/jobs/job.py index 91ed187b0841570b8314be4e27f69731487ae733..7f14cf05f6e03a1e6c6d4b1b51295955e66d21ba 100644 --- a/buildstream/_scheduler/jobs/job.py +++ b/buildstream/_scheduler/jobs/job.py @@ -184,6 +184,16 @@ class Job(): self._terminated = True + # get_terminated() + # + # Check if a job has been terminated. + # + # Returns: + # (bool): True in the main process if Job.terminate() was called. + # + def get_terminated(self): + return self._terminated + # terminate_wait() # # Wait for terminated jobs to complete diff --git a/buildstream/_scheduler/queues/queue.py b/buildstream/_scheduler/queues/queue.py index a20f44eea083779d22a34a3a07f0d338c0facc22..9f0563fa59e5d9c5ddc950eae68cc40df341548c 100644 --- a/buildstream/_scheduler/queues/queue.py +++ b/buildstream/_scheduler/queues/queue.py @@ -305,7 +305,7 @@ class Queue(): self._done_queue.append(element) # These lists are for bookkeeping purposes for the UI and logging. - if status == JobStatus.SKIPPED: + if status == JobStatus.SKIPPED or job.get_terminated(): self.skipped_elements.append(element) elif status == JobStatus.OK: self.processed_elements.append(element)