diff --git a/gerrit_util.py b/gerrit_util.py index d1ef98957..b08f82a8a 100755 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -347,7 +347,9 @@ def ReadHttpResponse(conn, accept_statuses=frozenset([200])): raise GerritAuthenticationError(response.status, reason) # If response.status < 500 then the result is final; break retry loop. - if response.status < 500: + # If the response is 404, it might be because of replication lag, so + # keep trying anyway. + if response.status < 500 and response.status != 404: LOGGER.debug('got response %d for %s %s', response.status, conn.req_params['method'], conn.req_params['uri']) break