From c1f3adb230fdbc2d9ff9315694504a5789f741d0 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Tue, 21 Jan 2020 13:05:33 -0800 Subject: [PATCH 1/2] retry on CIPD failure --- tools/fuchsia/merge_and_upload_debug_symbols.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/fuchsia/merge_and_upload_debug_symbols.py b/tools/fuchsia/merge_and_upload_debug_symbols.py index a27f2668996ce..4173af2e23c4d 100755 --- a/tools/fuchsia/merge_and_upload_debug_symbols.py +++ b/tools/fuchsia/merge_and_upload_debug_symbols.py @@ -60,8 +60,19 @@ def ProcessCIPDPackage(upload, cipd_yaml, engine_version, out_dir, target_arch): 'fuchsia-debug-symbols-%s.cipd' % target_arch) ] - subprocess.check_call(command, cwd=_packaging_dir) - + # Retry up to three times. We've seen CIPD fail on verification in some + # instances. Normally verification takes slightly more than 1 minute when + # it succeeds. + num_tries = 3 + while tries in range(num_tries): + try: + subprocess.check_call(command, cwd=_packaging_dir) + success = True + break + except subprocess.CalledProcessError: + print('Failed %s times' % tries + 1) + if tries == num_tries - 1: + raise def CreateTarFile(folder_path, base_dir): archive_name = os.path.basename(folder_path) From eb31b1df2bf99e0ab25ba26f36026414b45e035e Mon Sep 17 00:00:00 2001 From: Dan Field Date: Tue, 21 Jan 2020 13:09:37 -0800 Subject: [PATCH 2/2] unused var --- tools/fuchsia/merge_and_upload_debug_symbols.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/fuchsia/merge_and_upload_debug_symbols.py b/tools/fuchsia/merge_and_upload_debug_symbols.py index 4173af2e23c4d..34f16b760a7c2 100755 --- a/tools/fuchsia/merge_and_upload_debug_symbols.py +++ b/tools/fuchsia/merge_and_upload_debug_symbols.py @@ -67,7 +67,6 @@ def ProcessCIPDPackage(upload, cipd_yaml, engine_version, out_dir, target_arch): while tries in range(num_tries): try: subprocess.check_call(command, cwd=_packaging_dir) - success = True break except subprocess.CalledProcessError: print('Failed %s times' % tries + 1)