You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:55:52 UTC

[buildstream] 08/12: _scheduler/queues: Add failed builds to "done" queue

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch richardmaw/wip/log-show
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 1546ce5ababf25196e824120eec31576423abdec
Author: Richard Maw <ri...@codethink.co.uk>
AuthorDate: Tue Jun 12 17:17:40 2018 +0100

    _scheduler/queues: Add failed builds to "done" queue
    
    This allows the scheduler to move jobs from the current queue to the next.
    
    As a result of this change later queues than the build queue
    mustn't skip a cached failure, so the logic is specialised to build queues only.
---
 buildstream/_scheduler/queues/buildqueue.py | 1 +
 buildstream/_scheduler/queues/queue.py      | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/buildstream/_scheduler/queues/buildqueue.py b/buildstream/_scheduler/queues/buildqueue.py
index 272f19f..5967fbf 100644
--- a/buildstream/_scheduler/queues/buildqueue.py
+++ b/buildstream/_scheduler/queues/buildqueue.py
@@ -60,6 +60,7 @@ class BuildQueue(Queue):
                              action_cb=self.process,
                              complete_cb=self._job_done,
                              max_retries=self._max_retries)
+            self._done_queue.append(job)
             self.failed_elements.append(element)
             self._scheduler._job_complete_callback(job, False)
 
diff --git a/buildstream/_scheduler/queues/queue.py b/buildstream/_scheduler/queues/queue.py
index 6c15834..28da177 100644
--- a/buildstream/_scheduler/queues/queue.py
+++ b/buildstream/_scheduler/queues/queue.py
@@ -296,6 +296,7 @@ class Queue():
     # See the Job object for an explanation of the call signature
     #
     def _job_done(self, job, element, success, result):
+        element._update_state()
 
         # Update values that need to be synchronized in the main task
         # before calling any queue implementation
@@ -335,8 +336,9 @@ class Queue():
 
             # No exception occured, handle the success/failure state in the normal way
             #
+            self._done_queue.append(job)
+
             if success:
-                self._done_queue.append(job)
                 if processed:
                     self.processed_elements.append(element)
                 else: