summaryrefslogtreecommitdiff
path: root/zuul/scheduler.py
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2017-09-20 13:48:32 -0700
committerJames E. Blair <jeblair@redhat.com>2017-09-20 13:50:52 -0700
commit027ba992595d23e920a9cf84f67c87959a4b2a13 (patch)
tree4504bbc8d52cfd1954b4902676c0a8bfa0f9604a /zuul/scheduler.py
parentfc915c5a85d2616db00164bc081786d7065e9d14 (diff)
downloadzuul-027ba992595d23e920a9cf84f67c87959a4b2a13.tar.gz
Fix infinite loop on reconfiguration exception
If there was an error re-enqueing a change during reconfiguration, we would abort reconfiguration after having moved some changes into the new pipelines. Once we start doing this, we need to finish it, otherwise items will be in change queues which are no longer attached to the pipelines in use. To avoid the issue, simply remove an item from the pipeline if an exception is raised while re-enqueing it. This is bad, but not as bad as an infinite loop. Change-Id: I628e599671b7d2d14ae981d65d04e37b23d26831
Diffstat (limited to 'zuul/scheduler.py')
-rw-r--r--zuul/scheduler.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 806ba869e..543266189 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -543,9 +543,16 @@ class Scheduler(threading.Thread):
tenant, item)
item.item_ahead = None
item.items_behind = []
- if (item.change.project and
- new_pipeline.manager.reEnqueueItem(item,
- last_head)):
+ reenqueued = False
+ if item.change.project:
+ try:
+ reenqueued = new_pipeline.manager.reEnqueueItem(
+ item, last_head)
+ except Exception:
+ self.log.exception(
+ "Exception while re-enqueing item %s",
+ item)
+ if reenqueued:
for build in item.current_build_set.getBuilds():
new_job = item.getJob(build.job.name)
if new_job: