upload_symbols: put a timeout on the upload operation
If sym_upload itself chokes while talking to the server, we don't have
any timeout in place so that we gracefully recover. Add one.
While we're here, move the RunCommand output to the --debug level so
the default output is a bit quieter.
BUG=chromium:254208
TEST=`upload_symbols --board x86-alex --yes --upload-count 1` works
TEST=`./scripts/upload_symbols_unittest.py` passes
Change-Id: Idf3c2815a433033f783783404b6eb3ee4ce261a2
Reviewed-on: https://gerrit.chromium.org/gerrit/60132
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/upload_symbols.py b/scripts/upload_symbols.py
index 2b89a83..5f8e956 100644
--- a/scripts/upload_symbols.py
+++ b/scripts/upload_symbols.py
@@ -35,6 +35,11 @@
DEFAULT_FILE_LIMIT = CRASH_SERVER_FILE_LIMIT - (10 * 1024 * 1024)
+# How long to wait (in seconds) for a single upload to complete. This has
+# to allow for symbols that are up to CRASH_SERVER_FILE_LIMIT in size.
+UPLOAD_TIMEOUT = 30 * 60
+
+
# Sleep for 200ms in between uploads to avoid DoS'ing symbol server.
DEFAULT_SLEEP_DELAY = 0.2
@@ -58,7 +63,9 @@
# reads the sym_file and does a HTTP post to URL with a few fields set.
# See the tiny breakpad/tools/linux/symupload/sym_upload.cc for details.
cmd = ['sym_upload', sym_file, upload_url]
- return cros_build_lib.RunCommandCaptureOutput(cmd)
+ with cros_build_lib.SubCommandTimeout(UPLOAD_TIMEOUT):
+ return cros_build_lib.RunCommandCaptureOutput(
+ cmd, debug_level=logging.DEBUG)
def TestingSymUpload(sym_file, upload_url):