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

Unified Diff: devil/devil/android/sdk/adb_wrapper.py

Issue 2447583002: [devil] Work around occasionally fatal `adb forward --list` bug. (Closed)
Patch Set: remove extra line Created 4 years, 2 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
Index: devil/devil/android/sdk/adb_wrapper.py
diff --git a/devil/devil/android/sdk/adb_wrapper.py b/devil/devil/android/sdk/adb_wrapper.py
index 924aaa649b60138896d7edf64b612b9a020cf5af..8654d269949104295c23551a54ee2c29adde1aa8 100644
--- a/devil/devil/android/sdk/adb_wrapper.py
+++ b/devil/devil/android/sdk/adb_wrapper.py
@@ -637,7 +637,20 @@ class AdbWrapper(object):
Args:
timeout: (optional) Timeout per try in seconds.
retries: (optional) Number of retries to attempt.
+ Returns:
+ The output of adb forward --list as a string.
"""
+ if (distutils.version.LooseVersion(self.Version()) >=
+ distutils.version.LooseVersion('1.0.36')):
+ # Starting in 1.0.36, this can occasionally fail with a protocol fault.
+ # As this interrupts all connections with all devices, we instead just
+ # return an empty list. This may give clients an inaccurate result, but
+ # that's usually better than crashing the adb server.
+
+ # TODO(jbudorick): Determine an appropriate upper version bound for this
+ # once b/31811775 is fixed.
nednguyen 2016/10/24 12:05:50 Should we remove the bug reference since this is i
jbudorick 2016/10/24 13:46:16 I'd definitely like to leave it here. It's certain
+ return ''
+
return self._RunDeviceAdbCmd(['forward', '--list'], timeout, retries)
def JDWP(self, timeout=DEFAULT_TIMEOUT, retries=DEFAULT_RETRIES):

Powered by Google App Engine
This is Rietveld 408576698