Game: the performance statistics sender deletes summaries on a 404 or a redirect, can send twice, and sends more than the service takes at once #1265
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#1265
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Longshot version
main at
17394b7111(the merge of #983).nx2/perf_report.pyis unchanged on main2547a8f3dd.Channel
Built from source
What kind of problem
Something else
What happened
nx2/perf_report.py, which the launcher starts at its start to send what the game left inperf_pending/, has three ways to lose or double data, all silent (its output goes to the null device, line 415):answer()(def answer(code, retry_after=None):send_thesethen deletes the file (line 367). A 404 from the ingress while the service is redeployed or its route is missing, a redirect (http.client does not follow one), 408 or 425 would drop up to 12 summaries a start. Only 400, 413, 415 and 422 mean "this summary will never be taken".start_sending(line 409) starts a detached--sendat each launcher start, with no lock. If the first is still waiting on its 10 s timeout or a slow link, a second reads the sameperf_pending/and can post the same summaries, which the service counts twice (a summary has no ID, so it cannot dedupe).LONGSHOT_PERF_MAX_SENDS, line 304). The perf route's ingress rate limit is 6 a minute with a burst of 6 per address (deploy/telemetry/40-ingress.yamlin the deploy repo, lines 37 and 39). A player with more than 6 waiting (more than half an hour of play since the launcher last ran) gets a 429 on the 7th, which the sender reads as "busy" and answers with a wait of at least an hour, doubling to a day (BUSY_FIRST,BUSY_MOST, line 52). Nothing is lost, but the rest arrives a day late. I did not test whether the 429 carries a Retry-After.Also worth knowing, not a bug: the sender only runs when the launcher starts, so a game started from Steam or a shortcut never sends and up to 48 summaries wait (older ones are dropped past that, line 310).
Where in the game
Not in the game: the launcher's start, and
python -I nx2/perf_report.py <game folder> --send.How often
1 and 3: every time the condition holds (a missing route during a deploy; more than 6 summaries waiting). 2: rarely.
Graphics card and driver version
Not applicable.
CPU, RAM and operating system
Not specific; the sender is the same Python on Windows and Linux.
Changes from the defaults
None.
longshot_log.txt
Not attached: read from the code, the game-free
tests/test_perf_report.py(passes on main), and the deploy config.Screenshots or video
Not applicable.
What would fix it
tests/test_perf_report.py(it already has a local relay).--send: createperf_pending/.sendingwithO_EXCL, treat it as stale after a few minutes, and exit when it is held.Before you send it
Claiming this for the fix: answer() reclassified so 3xx/404/408/425 keep the summary (later) and only 400/413/415/422 delete it (refused); an O_EXCL lock on perf_pending/.sending with stale takeover for the detached sender; and LONGSHOT_PERF_MAX_SENDS default lowered to 5 with the ingress limit (6 a minute, burst 6) written next to both numbers. Tests per case in tests/test_perf_report.py's local relay.