diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-11 01:06:59 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-11 01:06:59 +0000 |
commit | b6f068317fceed7f0a7c621e29354a7af94443b8 (patch) | |
tree | 94365af49ba158885cbd73299259621686655646 /tools/telemetry | |
parent | fee637a4d8852acbd602eee2cdb09b87dd37c926 (diff) | |
download | chromium_src-b6f068317fceed7f0a7c621e29354a7af94443b8.zip chromium_src-b6f068317fceed7f0a7c621e29354a7af94443b8.tar.gz chromium_src-b6f068317fceed7f0a7c621e29354a7af94443b8.tar.bz2 |
[Telemetry] Fix a few more potential deadlocks.
This builds on https://codereview.chromium.org/385653002/ .
Many functions in Python's logging module grab a lock internally. Some
appear to do so before converting the provided message to a string via
its __str__ method.
Calling an object's __str__ method before calling a logging funciton
allows anything called by the __str__ method to log without the risk of
hitting a deadlock.
BUG=392869
Review URL: https://codereview.chromium.org/383793002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/telemetry')
3 files changed, 4 insertions, 4 deletions
diff --git a/tools/telemetry/telemetry/benchmark.py b/tools/telemetry/telemetry/benchmark.py index 5f3c75d..5af51fd 100644 --- a/tools/telemetry/telemetry/benchmark.py +++ b/tools/telemetry/telemetry/benchmark.py @@ -127,7 +127,7 @@ class Benchmark(command_line.Command): 'If you believe you have credentials, follow the ' 'instructions below.', generated_profile_archive_path) - logging.error(e) + logging.error(str(e)) sys.exit(-1) # Unzip profile directory. diff --git a/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py b/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py index d08713d..bc13384 100644 --- a/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py +++ b/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py @@ -90,7 +90,7 @@ def FindAllAvailableBrowsers(finder_options): except urllib2.URLError as e: logging.debug('Error communicating with devices over %s.' % IOS_WEBKIT_DEBUG_PROXY) - logging.debug(e) + logging.debug(str(e)) return [] # TODO(baxley): Move to ios-webkit-debug-proxy command class, similar diff --git a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py index 71c68bb..92861be 100644 --- a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py +++ b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py @@ -93,7 +93,7 @@ class LinuxPlatformBackend( changed |= cloud_storage.GetIfChanged( ipfw_mod, cloud_storage.INTERNAL_BUCKET) except cloud_storage.CloudStorageError, e: - logging.error(e) + logging.error(str(e)) logging.error('You may proceed by manually installing dummynet. See: ' 'http://info.iet.unipi.it/~luigi/dummynet/') sys.exit(1) @@ -114,7 +114,7 @@ class LinuxPlatformBackend( cloud_storage.GetIfChanged(bin_path, cloud_storage.INTERNAL_BUCKET) os.chmod(bin_path, 0755) except cloud_storage.CloudStorageError, e: - logging.error(e) + logging.error(str(e)) if fallback_package: logging.error('You may proceed by manually installing %s via:\n' 'sudo apt-get install %s' % (bin_name, fallback_package)) |