summaryrefslogtreecommitdiff
path: root/zuul/manager/__init__.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-11-10 12:32:07 +0000
committerGerrit Code Review <review@openstack.org>2022-11-10 12:32:07 +0000
commitfe49687f29aa2ce778cf1305b051bf60499e0536 (patch)
treed758718692f9f8badb2c4fe61810d77064feb1ef /zuul/manager/__init__.py
parent1e1f5ce3a312613fc79ba9de5305cb7972e2a10f (diff)
parentc355adf44e18fc5d8c8e30dccbada1d9bbcd0c19 (diff)
downloadzuul-fe49687f29aa2ce778cf1305b051bf60499e0536.tar.gz
Merge "Add playbook semaphores"
Diffstat (limited to 'zuul/manager/__init__.py')
-rw-r--r--zuul/manager/__init__.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/zuul/manager/__init__.py b/zuul/manager/__init__.py
index 69f57c9db..cb0320310 100644
--- a/zuul/manager/__init__.py
+++ b/zuul/manager/__init__.py
@@ -963,7 +963,10 @@ class PipelineManager(metaclass=ABCMeta):
# current item so a potentially aquired semaphore must be
# released as it won't be released on dequeue of the item.
tenant = item.pipeline.tenant
- tenant.semaphore_handler.release(self.sched, item, job)
+ pipeline = build_set.item.pipeline
+ event_queue = self.sched.pipeline_result_events[
+ tenant.name][pipeline.name]
+ tenant.semaphore_handler.release(event_queue, item, job)
except Exception:
log.exception("Exception while releasing semaphore")
@@ -1800,8 +1803,11 @@ class PipelineManager(metaclass=ABCMeta):
item = build.build_set.item
log.debug("Build %s of %s completed" % (build, item.change))
+
+ event_queue = self.sched.pipeline_result_events[
+ item.pipeline.tenant.name][item.pipeline.name]
item.pipeline.tenant.semaphore_handler.release(
- self.sched, item, build.job)
+ event_queue, item, build.job)
if item.getJob(build.job.name) is None:
log.info("Build %s no longer in job graph for item %s",
@@ -1974,9 +1980,12 @@ class PipelineManager(metaclass=ABCMeta):
build_set.item.setNodeRequestFailure(
job, f'Node request {request.id} failed')
self._resumeBuilds(build_set)
- tenant = build_set.item.pipeline.tenant
+ pipeline = build_set.item.pipeline
+ tenant = pipeline.tenant
+ event_queue = self.sched.pipeline_result_events[
+ tenant.name][pipeline.name]
tenant.semaphore_handler.release(
- self.sched, build_set.item, job)
+ event_queue, build_set.item, job)
log.info("Completed node request %s for job %s of item %s "
"with nodes %s",