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 <jchinlee@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
changes/50/713750/3
Ryan Tseng 7 years ago committed by Commit Bot
parent b3ce73d028
commit 8f572a579a

@ -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:

Loading…
Cancel
Save