summaryrefslogtreecommitdiff
path: root/zuul/scheduler.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-06-26 18:39:18 +0000
committerGerrit Code Review <review@openstack.org>2019-06-26 18:39:18 +0000
commit7d19df49e509a03d35457a0e8126703427875d7c (patch)
tree85463e566a8444822b11cb8effaa1a57b0b944df /zuul/scheduler.py
parent1bcd84ed3e610e886065ae5fb6771bc0e9e8581e (diff)
parent7187a66f5e106cfdb2bee1b8dfd9f5d275d11f02 (diff)
downloadzuul-7d19df49e509a03d35457a0e8126703427875d7c.tar.gz
Merge "Fix build leak with paused jobs"
Diffstat (limited to 'zuul/scheduler.py')
-rw-r--r--zuul/scheduler.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index a5682953c..af6096b7e 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -1200,10 +1200,20 @@ class Scheduler(threading.Thread):
log = get_annotated_logger(self.log, build.zuul_event_id)
if build.build_set is not build.build_set.item.current_build_set:
log.warning("Build %s is not in the current build set", build)
+ try:
+ self.executor.cancel(build)
+ except Exception:
+ log.exception(
+ "Exception while canceling paused build %s", build)
return
pipeline = build.build_set.item.pipeline
if not pipeline:
log.warning("Build %s is not associated with a pipeline", build)
+ try:
+ self.executor.cancel(build)
+ except Exception:
+ log.exception(
+ "Exception while canceling paused build %s", build)
return
pipeline.manager.onBuildPaused(event.build)