If there is already a post pipeline defined a force-merge of a change
referencing a non-existent project template currently can wedge the
scheduler. In this case an exception is raised during reporting which
throws the run handler completely out of its loop and the loop starts
over from the beginning. However the item to be reported is not
consumed in this case so zuul is stuck in an exception loop [1] and
can only be recovered by a restart.
This can be fixed by catching the exception and continuing the
reporting.
[1] Traceback:
2019-01-28 07:33:57,304 ERROR zuul.Scheduler: Exception in run handler:
Traceback (most recent call last):
File "/opt/zuul/lib/python3.6/site-packages/zuul/scheduler.py", line 1033, in run
while (pipeline.manager.processQueue() and
File "/opt/zuul/lib/python3.6/site-packages/zuul/manager/__init__.py", line 768, in processQueue
item, nnfi)
File "/opt/zuul/lib/python3.6/site-packages/zuul/manager/__init__.py", line 735, in _processOneItem
self.reportItem(item)
File "/opt/zuul/lib/python3.6/site-packages/zuul/manager/__init__.py", line 880, in reportItem
item.reported = not self._reportItem(item)
File "/opt/zuul/lib/python3.6/site-packages/zuul/manager/__init__.py", line 920, in _reportItem
if not layout.getProjectPipelineConfig(item):
File "/opt/zuul/lib/python3.6/site-packages/zuul/model.py", line 3435, in getProjectPipelineConfig
templates = self.getProjectTemplates(template_name)
File "/opt/zuul/lib/python3.6/site-packages/zuul/model.py", line 3374, in getProjectTemplates
raise TemplateNotFoundError("Project template %s not found" % name)
zuul.model.TemplateNotFoundError: Project template foo not found
Change-Id: I1a3b59dadbd9337a8ba5b146f09ad093a0123ce8