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

Unified Diff: scripts/slave/bot_update.py

Issue 1254753002: Add exponential backoff to bot_update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Address final nit. Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/bot_update.py
diff --git a/scripts/slave/bot_update.py b/scripts/slave/bot_update.py
index 65a8178e0a959c14e5c0502a0e16dbef3f13d726..b86262f2159c4bb2b7261f87eec3d320bb614311 100755
--- a/scripts/slave/bot_update.py
+++ b/scripts/slave/bot_update.py
@@ -14,6 +14,7 @@ import json
import optparse
import os
import pprint
+import random
import re
import socket
import subprocess
@@ -415,6 +416,11 @@ def call(*args, **kwargs): # pragma: no cover
return outval
if result is FAIL:
break
+ if result is RETRY:
+ sleep_backoff = 4 ** attempt
+ sleep_time = random.randint(sleep_backoff, int(sleep_backoff * 1.2))
+ print '===backing off, sleeping for %d secs===' % sleep_time
+ time.sleep(sleep_time)
raise SubprocessFailed('%s failed with code %d in %s after %d attempts.' %
(' '.join(args), code, cwd, attempt),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698