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
This commit is contained in:
Monty Taylor 2018-01-21 11:58:05 -06:00
parent 495a52d2ae
commit 12c2747eff
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 10 additions and 1 deletions

View File

@ -775,7 +775,16 @@ class AnsibleJob(object):
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))