Commit 8f572a57 authored by Ryan Tseng's avatar Ryan Tseng Committed by Commit Bot

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/713750Reviewed-by: 's avatarJao-ke Chin-Lee <jchinlee@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
parent b3ce73d0
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment