From 8f572a579ae88523418d33594bd529b0e9bdddbd Mon Sep 17 00:00:00 2001 From: Ryan Tseng Date: Wed, 11 Oct 2017 12:51:24 -0700 Subject: [PATCH] download_from_google_storage: call gsutil.py once before anything else happens Normally, if dfgs is started with multiple threads, the first time gsutil.py is called, it may be called by many different threads at the same time and hit a race condition where multiple threads are all trying to download gsutil at the same time. This works around the problem by calling it for the first time in the main thread before anything else happens. Bug: 773671 Change-Id: Ie75d90d6d20d11f46a601500b75a198fa5e5f111 Reviewed-on: https://chromium-review.googlesource.com/713750 Reviewed-by: Jao-ke Chin-Lee Commit-Queue: Ryan Tseng --- download_from_google_storage.py | 1 + 1 file changed, 1 insertion(+) diff --git a/download_from_google_storage.py b/download_from_google_storage.py index 98fc5d441c..1cbc8c6eb5 100755 --- a/download_from_google_storage.py +++ b/download_from_google_storage.py @@ -488,6 +488,7 @@ def main(args): else: parser.error('gsutil not found in %s, bad depot_tools checkout?' % GSUTIL_DEFAULT_PATH) + gsutil.check_call('version') # Call this once to ensure it exists. # Passing in -g/--config will run our copy of GSUtil, then quit. if options.config: