Commit 2f8b0c1d authored by Dan Jacques's avatar Dan Jacques Committed by Commit Bot

git_retry: Disable retries under Git wrapper.

If the Infra Git wrapper is managing a Git execution, "git_retry" will
impose a second set of retries. Recognize this situation and disable
"git_retry" so that the Git wrapper is the sole managing process.

BUG=chromium:703868
TEST=local
  - Ran with and without environment variable, seems to work.

Change-Id: I4f749c9693a761abe2a062ed5f1dc09f51c69e30
Reviewed-on: https://chromium-review.googlesource.com/469229
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
parent 1c03726d
......@@ -48,6 +48,14 @@ FREEZE_SECTIONS = {
FREEZE_MATCHER = re.compile(r'%s.(%s)' % (FREEZE, '|'.join(FREEZE_SECTIONS)))
# NOTE: This list is DEPRECATED in favor of the Infra Git wrapper:
# https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/tools/git
#
# New entries should be added to the Git wrapper, NOT to this list. "git_retry"
# is, similarly, being deprecated in favor of the Git wrapper.
#
# ---
#
# Retry a git operation if git returns a error response with any of these
# messages. It's all observed 'bad' GoB responses so far.
#
......
......@@ -3,8 +3,16 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generic retry wrapper for Git operations.
This is largely DEPRECATED in favor of the Infra Git wrapper:
https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/tools/git
"""
import logging
import optparse
import os
import subprocess
import sys
import threading
......@@ -111,6 +119,11 @@ class GitRetry(object):
def main(args):
# If we're using the Infra Git wrapper, do nothing here.
# https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/tools/git
if 'INFRA_GIT_WRAPPER' in os.environ:
return subprocess.call([GIT_EXE] + args)
parser = optparse.OptionParser()
parser.disable_interspersed_args()
parser.add_option('-v', '--verbose',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment