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

Unified Diff: gclient_scm.py

Issue 1812001: Standardize automatic retry and add a 15 seconds sleep to increase the chances of success (Closed)
Patch Set: Created 10 years, 8 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 | « no previous file | scm.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index d69a1d3f49adc2ca1f8a197548737ecb0663faeb..947ccd791f12c53c0ed8871ae099c82292d8bbe4 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -9,6 +9,7 @@ import os
import posixpath
import re
import subprocess
+import time
import scm
import gclient_utils
@@ -252,21 +253,22 @@ class GitWrapper(SCMWrapper):
raise gclient_utils.Error('Invalid Upstream')
# Update the remotes first so we have all the refs.
- for _ in range(3):
+ for _ in range(10):
try:
remote_output, remote_err = scm.GIT.Capture(
['remote'] + verbose + ['update'],
self.checkout_path,
print_error=False)
break
- except gclient_utils.CheckCallError, e:
+ except gclient_utils.CheckCallError:
# Hackish but at that point, git is known to work so just checking for
# 502 in stderr should be fine.
if '502' in e.stderr:
print str(e)
- print "Retrying..."
+ print "Sleeping 15 seconds and retrying..."
+ time.sleep(15)
continue
- raise e
+ raise
if verbose:
print remote_output.strip()
« no previous file with comments | « no previous file | scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698