Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: git_common.py

Issue 401673003: Added 'git-retry' bootstrap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: More updates. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git-retry ('k') | git_retry.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_common.py
diff --git a/git_common.py b/git_common.py
index 298ecc4ff3a8c9ee8f9263130b3751167b5eb5fa..0c537134ffea38674a5db7b61f70b4a3612e224b 100644
--- a/git_common.py
+++ b/git_common.py
@@ -42,6 +42,55 @@ FREEZE_SECTIONS = {
FREEZE_MATCHER = re.compile(r'%s.(%s)' % (FREEZE, '|'.join(FREEZE_SECTIONS)))
+# Retry a git operation if git returns a error response with any of these
+# messages. It's all observed 'bad' GoB responses so far.
+#
+# This list is inspired/derived from the one in ChromiumOS's Chromite:
+# <CHROMITE>/lib/git.py::GIT_TRANSIENT_ERRORS
+#
+# It was last imported from '7add3ac29564d98ac35ce426bc295e743e7c0c02'.
+GIT_TRANSIENT_ERRORS = (
+ # crbug.com/285832
+ r'! \[remote rejected\].*\(error in hook\)',
+
+ # crbug.com/289932
+ r'! \[remote rejected\].*\(failed to lock\)',
+
+ # crbug.com/307156
+ r'! \[remote rejected\].*\(error in Gerrit backend\)',
+
+ # crbug.com/285832
+ r'remote error: Internal Server Error',
+
+ # crbug.com/294449
+ r'fatal: Couldn\'t find remote ref ',
+
+ # crbug.com/220543
+ r'git fetch_pack: expected ACK/NAK, got',
+
+ # crbug.com/189455
+ r'protocol error: bad pack header',
+
+ # crbug.com/202807
+ r'The remote end hung up unexpectedly',
+
+ # crbug.com/298189
+ r'TLS packet with unexpected length was received',
+
+ # crbug.com/187444
+ r'RPC failed; result=\d+, HTTP code = \d+',
+
+ # crbug.com/315421
+ r'The requested URL returned error: 500 while accessing',
+
+ # crbug.com/388876
+ r'Connection timed out',
+)
+
+GIT_TRANSIENT_ERRORS_RE = re.compile('|'.join(GIT_TRANSIENT_ERRORS),
+ re.IGNORECASE)
+
+
class BadCommitRefException(Exception):
def __init__(self, refs):
msg = ('one of %s does not seem to be a valid commitref.' %
« no previous file with comments | « git-retry ('k') | git_retry.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698