From d91b6cb75a34da9b11782c789b3d59706dfaaac9 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Wed, 21 Dec 2022 09:12:13 -0500 Subject: [PATCH] upload_system_symbols: Don't retry if file already exists on the server Bug: 1400770 Change-Id: I4c9c683c91848f7eb404ff3c86187dfa63d06e37 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4117730 Reviewed-by: Robert Sesek --- src/tools/mac/upload_system_symbols/upload_system_symbols.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/src/tools/mac/upload_system_symbols/upload_system_symbols.go index 8f5c773f..52c197c4 100644 --- a/src/tools/mac/upload_system_symbols/upload_system_symbols.go +++ b/src/tools/mac/upload_system_symbols/upload_system_symbols.go @@ -229,6 +229,11 @@ func (uq *UploadQueue) worker() { // Success. No retry needed. fmt.Printf("Uploaded %s to %s\n", symfile, server) break + } else if exitError, ok := err.(*exec.ExitError); ok && exitError.ExitCode() == 2 && *apiKey != "" { + // Exit code 2 in protocol v2 means the file already exists on the server. + // No point retrying. + fmt.Printf("File %s already exists on %s\n", symfile, server) + break } else { log.Printf("Error running symupload(%s, %s), attempt %d: %v: %s\n", symfile, server, i, err, output) time.Sleep(1 * time.Second)