summaryrefslogtreecommitdiff
path: root/src/buildstream/_stream.py
diff options
context:
space:
mode:
authorTom Pollard <tom.pollard@codethink.co.uk>2019-08-14 15:02:00 +0100
committerTom Pollard <tom.pollard@codethink.co.uk>2019-08-15 12:25:47 +0100
commitf807cf8c348c7daeb8101e079416374824ec9dfe (patch)
tree7de928fc89873917c0b18ee9194826354dfcc38e /src/buildstream/_stream.py
parente52bc8e68601a17226c33821f979aef4c9368da9 (diff)
downloadbuildstream-tpollard/frontendelement.tar.gz
_frontend/app.py: Don't determine queue for retrying in frontendtpollard/frontendelement
When retrying a failed job Stream as the queue owner should handle the element enqueue and failed task deletion. After frontend process separation it will also not be plausible to pickle the queue object.
Diffstat (limited to 'src/buildstream/_stream.py')
-rw-r--r--src/buildstream/_stream.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 51bb1c7ab..44147fc76 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -1289,15 +1289,25 @@ class Stream():
# _failure_retry()
#
- # Enqueues given element via unique_id to the specified queue and
- # remove the related failed task from the related group
- #
+ # Enqueues given element via unique_id to the specified queue
+ # matched against provided action_name & removes the related
+ # failed task from the tasks group.
#
# Args:
- # queue (Queue): The target queue
+ # action_name (str): The name of the action being performed
# unique_id (str): A unique_id to load an Element instance
#
- def _failure_retry(self, queue, unique_id):
+ # Raises:
+ # (StreamError): If the related queue cannot be found
+ #
+ def _failure_retry(self, action_name, unique_id):
+ queue = None
+ # Attempt to resolve the required queue
+ for queue in self.queues:
+ if queue.action_name == action_name:
+ queue = queue
+ if not queue:
+ raise StreamError()
element = Plugin._lookup(unique_id)
queue._task_group.failed_tasks.remove(element._get_full_name())
queue.enqueue([element])