Skip to content

Commit 6a25efc

Browse files
ConradIrwindvdsk
authored andcommitted
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
1 parent df4a134 commit 6a25efc

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

script/bundle-linux

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,20 @@ else
9292
echo "Uploading zed debug symbols to sentry..."
9393
# note: this uploads the unstripped binary which is needed because it contains
9494
# .eh_frame data for stack unwinding. see https://github.com/getsentry/symbolic/issues/783
95-
sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \
96-
"${target_dir}/${target_triple}"/release/zed \
97-
"${target_dir}/${remote_server_triple}"/release/remote_server
95+
for attempt in 1 2 3; do
96+
echo "Attempting sentry upload (attempt $attempt/3)..."
97+
if sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \
98+
"${target_dir}/${target_triple}"/release/zed \
99+
"${target_dir}/${remote_server_triple}"/release/remote_server; then
100+
echo "Sentry upload successful on attempt $attempt"
101+
break
102+
else
103+
echo "Sentry upload failed on attempt $attempt"
104+
if [ $attempt -eq 3 ]; then
105+
echo "All sentry upload attempts failed"
106+
fi
107+
fi
108+
done
98109
else
99110
echo "missing SENTRY_AUTH_TOKEN. skipping sentry upload."
100111
fi

script/bundle-mac

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,21 @@ function upload_debug_symbols() {
300300
# note: this uploads the unstripped binary which is needed because it contains
301301
# .eh_frame data for stack unwinding. see https://github.com/getsentry/symbolic/issues/783
302302
sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \
303-
"target/${target_triple}/${target_dir}/zed.dwarf" \
304-
"target/${target_triple}/${target_dir}/remote_server.dwarf"
303+
# Try uploading up to 3 times
304+
for attempt in 1 2 3; do
305+
echo "Sentry upload attempt $attempt..."
306+
if sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \
307+
"target/${target_triple}/${target_dir}/zed.dwarf" \
308+
"target/${target_triple}/${target_dir}/remote_server.dwarf"; then
309+
break
310+
else
311+
echo "Sentry upload failed on attempt $attempt"
312+
if [ $attempt -eq 3 ]; then
313+
echo "All sentry upload attempts failed"
314+
exit 1
315+
fi
316+
fi
317+
done
305318
else
306319
echo "missing SENTRY_AUTH_TOKEN. skipping sentry upload."
307320
fi

script/bundle-windows.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,20 @@ function UploadToSentry {
147147
return
148148
}
149149
Write-Output "Uploading zed debug symbols to sentry..."
150-
sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev $CargoOutDir
150+
for ($i = 1; $i -le 3; $i++) {
151+
try {
152+
sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev $CargoOutDir
153+
break
154+
}
155+
catch {
156+
Write-Output "Sentry upload attempt $i failed: $_"
157+
if ($i -eq 3) {
158+
Write-Output "All sentry upload attempts failed"
159+
throw
160+
}
161+
Start-Sleep -Seconds 2
162+
}
163+
}
151164
}
152165

153166
function MakeAppx {

0 commit comments

Comments
 (0)