fix(release): an upload the forge answers with a 5xx is made again, four times in all #598
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!598
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/release-upload-retry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: fix · Risk: low · Tested on: not run (a release script; CI runs its checks) · Needs: none
Why
The nightly of
82886e89was built and signed and then never reached players: the forge answered the upload of its AppImage with an error (HTTP 500), and the release script gives up on the first failed upload. Three of the eight Sign and publish jobs of 14 November failed. A release should not be lost to one bad answer from the server.No issue in the tracker for it.
How to reproduce
Seen on: the Release workflow on git.magicbean.dev, run https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/9342 (the Sign and publish job)
Settings and switches: defaults
Steps: a push to
mainwhose release reaches Publish while the forge answers an upload with a 5xxExpected: the nightly is published with its five files
Actual:
release.py: POST /repos/MagicBeanDev/Longshot/releases/5524/assets?name=Longshot-nightly-161-82886e89-x86_64.AppImage: HTTP 500 {"message":"","url":"https://git.magicbean.dev/api/swagger"}, the job fails, andnightly-161-82886e89stays a draft with no filesWhat changed
An upload of a release file that the server answers with a 5xx, or whose connection is dropped, is made again: four tries in all, 20, 40 and 60 seconds apart. Before each new try, what the failed one left under the file's name is removed. After the fourth failure the run ends as it does today and the draft stays unpublished.
upload_file()inscripts/release.py(new;publish()calls it for each file),api(..., again=True)raisingServerTroublefor a 5xx or a lost connection instead of ending the run,UPLOAD_TRIESandUPLOAD_PAUSE. Every other request, and a 4xx on an upload (the size or type limits), fails at once as before.RELEASING.md's troubleshooting table.This does not find why the forge answered 500: that is in the server's own log. It keeps a passing fault from costing a release.
Measurements
Verdict: nothing to measure: a release script, covered by its game-free checks.
Flags and settings
None.
Testing
Tested: nothing was run on the author's PC (no test suites run there). Two checks were added to
tests/test_release.pyagainst its fake Forgejo, for CI:test_an_upload_the_server_fails_is_made_again(a 500 that leaves a half file, then a dropped connection, then a good upload: one file on the release, the half file deleted, published) andtest_an_upload_that_keeps_failing_ends_the_release_unpublished(four 500s: the run fails and the release stays a draft).Not tested: against git.magicbean.dev itself: the next nightly's Sign and publish is the first real run. Whether the forge's 500 goes away on a second try is not known; if it is a lasting fault on the server (its storage), four tries fail as one did, about two minutes later.
Must be tested: None.
Risks
What could break: publishing only. A failed upload now takes up to two minutes longer to fail for good. If the server took a file whole and still answered 5xx, that copy is deleted and uploaded again.
Turning it off: revert the commit.
Compatibility: Nothing changes.
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). CI runs it; not run on the author's PC.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e34avQ5cTCWow16MXn
WIP: fix(release): an upload the forge answers with a 5xx is made again, four times in allto fix(release): an upload the forge answers with a 5xx is made again, four times in all