Retry more aggressively if merger can't fetch refs
Sometimes the refs the merger needs to fetch can't be fetched. At the
moment, when this occurs, the job gets a RETRY_LIMIT error and no
additional information.
Change-Id: Ia245d448f22c4c79d53446f29d5f69a8130bc503
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index a8ab8c4..eed3bad 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -775,7 +775,16 @@
return data
def doMergeChanges(self, merger, items, repo_state):
- ret = merger.mergeChanges(items, repo_state=repo_state)
+ try:
+ ret = merger.mergeChanges(items, repo_state=repo_state)
+ except ValueError as e:
+ # Return ABORTED so that we'll try again. At this point all of
+ # the refs we're trying to merge should be valid refs. If we
+ # can't fetch them, it should resolve itself.
+ self.log.exception("Could not fetch refs to merge from remote")
+ result = dict(result='ABORTED')
+ self.job.sendWorkComplete(json.dumps(result))
+ return False
if not ret: # merge conflict
result = dict(result='MERGER_FAILURE')
self.job.sendWorkComplete(json.dumps(result))