From 279b76d44051db300de6c3e2606ea128646f6937 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 21 Nov 2025 13:29:08 -0700 Subject: [PATCH] Retry sentry uploads (#43267) We see internal server errors occasionally; and it's very annoying to have to re-run the entire step Release Notes: - N/A --- script/bundle-linux | 17 ++++++++++++++--- script/bundle-mac | 17 +++++++++++++++-- script/bundle-windows.ps1 | 15 ++++++++++++++- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/script/bundle-linux b/script/bundle-linux index dee60f01e6d1d0ba2624284a3e44c50b35a885c7..4f5c9f6e7eeb9875346d172dd8d0d2d5d0c2bd27 100755 --- a/script/bundle-linux +++ b/script/bundle-linux @@ -92,9 +92,20 @@ else echo "Uploading zed debug symbols to sentry..." # note: this uploads the unstripped binary which is needed because it contains # .eh_frame data for stack unwinding. see https://github.com/getsentry/symbolic/issues/783 - sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \ - "${target_dir}/${target_triple}"/release/zed \ - "${target_dir}/${remote_server_triple}"/release/remote_server + for attempt in 1 2 3; do + echo "Attempting sentry upload (attempt $attempt/3)..." + if sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \ + "${target_dir}/${target_triple}"/release/zed \ + "${target_dir}/${remote_server_triple}"/release/remote_server; then + echo "Sentry upload successful on attempt $attempt" + break + else + echo "Sentry upload failed on attempt $attempt" + if [ $attempt -eq 3 ]; then + echo "All sentry upload attempts failed" + fi + fi + done else echo "missing SENTRY_AUTH_TOKEN. skipping sentry upload." fi diff --git a/script/bundle-mac b/script/bundle-mac index 5ee6590a0c656cb56bc5ea091ca844d26b13e9e3..c6c925f073600336f4aa3114a732609481ade26e 100755 --- a/script/bundle-mac +++ b/script/bundle-mac @@ -300,8 +300,21 @@ function upload_debug_symbols() { # note: this uploads the unstripped binary which is needed because it contains # .eh_frame data for stack unwinding. see https://github.com/getsentry/symbolic/issues/783 sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \ - "target/${target_triple}/${target_dir}/zed.dwarf" \ - "target/${target_triple}/${target_dir}/remote_server.dwarf" + # Try uploading up to 3 times + for attempt in 1 2 3; do + echo "Sentry upload attempt $attempt..." + if sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \ + "target/${target_triple}/${target_dir}/zed.dwarf" \ + "target/${target_triple}/${target_dir}/remote_server.dwarf"; then + break + else + echo "Sentry upload failed on attempt $attempt" + if [ $attempt -eq 3 ]; then + echo "All sentry upload attempts failed" + exit 1 + fi + fi + done else echo "missing SENTRY_AUTH_TOKEN. skipping sentry upload." fi diff --git a/script/bundle-windows.ps1 b/script/bundle-windows.ps1 index a9f5eafcc670ad6d3f36eeee92c7e05fe80fb8af..48114a970ff272d52c9927c65788c65dc1a5c7e7 100644 --- a/script/bundle-windows.ps1 +++ b/script/bundle-windows.ps1 @@ -147,7 +147,20 @@ function UploadToSentry { return } Write-Output "Uploading zed debug symbols to sentry..." - sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev $CargoOutDir + for ($i = 1; $i -le 3; $i++) { + try { + sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev $CargoOutDir + break + } + catch { + Write-Output "Sentry upload attempt $i failed: $_" + if ($i -eq 3) { + Write-Output "All sentry upload attempts failed" + throw + } + Start-Sleep -Seconds 2 + } + } } function MakeAppx {