Loader: append crash reports as single records #2031
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2033"
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?
Imported from Marvisak/VIctory. Originally posted by BaggyALPHA on 2026-11-25T03:47:03Z.
Addresses the crash-record interleaving in section 3 of #2025. Coordination claim.
Formatting directly into the append handle can split the timestamp, process ID, and report body across multiple writes. Build the complete record first and issue one append. The existing record format is preserved. A short write is treated as a best-effort logging failure so a retry cannot split the record around another writer.
On Windows, a synthetic regression writes 128 reports from eight threads and verifies every header, identifier, and body. Restoring the old formatted append reproduced a corrupt header. With this change all 35 loader library tests passed. Strict Clippy with all targets and features and the asset-policy hook passed. No game files were used.
AI-assisted (OpenAI Codex).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:57:02Z.
Review: COMMENTED
Static review only: victory-loader tests are broken on macOS/Linux on main pre-existing (prepare::tests parse Mach-O as PE); compile-level verification only.
Crash reports appended as single records — atomicity fix for the crash-report writer; small, right direction.
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T03:50:15Z.
Triage verdict — Keep with #1966 (
96337cd)Evidence
Checks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by AgneyaK on 2026-11-25T03:54:21Z.
Checked this together with #1966, which also edits
crash.rs(stderr writes that can't panic): they merge cleanly in either order, and the combined tree is fine.main940d32f+ this PR (96337cd) + #1966 (3eab67c):cargo test -p victory-loader --locked10 runs in a row, all green. That's 35 unit tests, includingconcurrent_crash_records_stay_together, plus thecrash_logtests, including #1966'sreports_reach_the_log_when_stderr_is_closed.cargo clippy -p victory-loader --all-targets --locked -- -D warnings: clean.Not tested: the title (both are crash-path changes).
AI use: Claude Code (Claude Opus 5.5) ran the checks and wrote this; the results are from the runs described.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:18:49Z.
Automated triage for the maintainers.
Merge candidate (re-checked on
c53cf0e). Incrates/victory-loader/src/crash.rs,append_recordformats a crash record's header and body into one string and writes it with a singlewriteon an append handle. Before, reports from concurrent writers could interleave (#2025 section 3). A short write is reported and not retried, so another writer's record can't land between the pieces. The record format is unchanged, and the caller still ignores errors. The testconcurrent_crash_records_stay_togetherusestempfile, which is already a dev-dependency. No new dependencies.New since the last review:
c53cf0emoves the test belowuse super::*;and thewindows_sysimport, as suggested. It is a pure move, with the test body unchanged. #1966 also editscrash.rs, and a commenter reports the two merge cleanly in either order.On your reply: confirmed. The move is the only change.
CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by BaggyALPHA on 2026-11-25T14:54:23Z.
Thanks — the nit is fixed in
c53cf0e:concurrent_crash_records_stay_togethernow sits belowuse super::*;and thewindows_sysimport in the test module. Placement only; the test body is untouched, andgit diffof that commit is a pure move (the added and removed lines are the same set, 5 for 5).Re-verified on the new head:
cargo test -p victory-loader --locked35 unit tests plus the integration tests pass, including this one. Asset policy ran in the pre-commit hook (1 file ok). No change toappend_recordor the record format, so the earlier cross-process and #1966 integration results still describe this head.AI-assisted (Claude Code).