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

Unified Diff: build/android/pylib/android_commands.py

Issue 19471007: [android] Retry data pushes that fail due to device busy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index be9d1e06a7680cb33e722b4a52986f276bd66af9..c2d97eb1bf0be88342191b1b3fd430f82eb4485f 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -789,8 +789,21 @@ class AndroidCommands(object):
# 60 seconds which isn't sufficient for a lot of users of this method.
push_command = 'push %s %s' % (local_path, device_path)
self._LogShell(push_command)
- output = self._adb.SendCommand(push_command, timeout_time=30 * 60)
- assert _HasAdbPushSucceeded(output)
+
+ # Retry push with increasing backoff if the device is busy.
+ retry = 0
+ while True:
+ output = self._adb.SendCommand(push_command, timeout_time=30 * 60)
+ if _HasAdbPushSucceeded(output):
+ return
+ if 'resource busy' in output and retry < 3:
frankf 2013/07/18 17:54:07 If rm is required, then shouldn't you also being d
+ retry += 1
+ wait_time = 5 * retry
+ logging.error('Push failed, retrying in %d seconds: %s' %
+ (wait_time, output))
+ time.sleep(wait_time)
+ else:
+ raise Exception('Push failed: %s' % output)
def GetPushSizeInfo(self):
"""Get total size of pushes to the device done via PushIfNeeded()
« 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