dstorage: a request that panics fails, and its worker goes on #454

Merged
lautarocherro merged 2 commits from upstream-pr/454 into main 2026-11-28 01:32:41 +00:00
lautarocherro commented 2026-11-27 20:30:33 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lautarocherro on 2026-11-27T20:30:33Z.


What this changes

Refs #446. A panic in execute killed its worker and left the read marked running for good, so the status entries behind it never completed. That matches the report (running 1, no failure, every other read healthy). Static review found no panicking input in the decoders, so this does not prove the cause. It closes this failure mode either way, and the warning now tells the two candidates apart.

  • The worker catches a panic: the request fails with E_FAIL (no other failure uses it), its status completes, and the worker goes on.
  • a status entry is still pending now lists the reads running longest: age, worker (dstorage N), file, offset, options. A read running for seconds on a live worker is a stalled read (for example a pread that never returns), not a panic.

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory: 395 passed. Native cargo test -p victory-hle: 150 passed. null_out_pointers_fail_without_leaking_lanes_or_handles fails about 1 run in 10, on main too (12 of 100): it compares the scheduler's global next_id while other tests create queues.
  • New: a_panicking_request_fails_its_status_and_the_queue_goes_on, a_worker_survives_a_panic (both fail on main: "never completed"), running_reads_name_what_they_read, an_unsupported_source_is_not_read_for_its_name (the names in the warning and the failure line never read the source of a request execute refuses). A #[cfg(test)] tag makes a request panic; release builds are unchanged apart from the catch.
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings: passes, also with --all-features.
  • Ran the game, or not needed: not needed.

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md (none)
  • New diagnostics are behind a VICTORY_* variable and documented (none new; the existing warning gains a field)
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5532717940 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/454). Originally posted by [lautarocherro](https://github.com/lautarocherro) on 2026-11-27T20:30:33Z. --- ## What this changes Refs #446. A panic in `execute` killed its worker and left the read marked running for good, so the status entries behind it never completed. That matches the report (`running 1`, no failure, every other read healthy). Static review found no panicking input in the decoders, so this does not prove the cause. It closes this failure mode either way, and the warning now tells the two candidates apart. - The worker catches a panic: the request fails with `E_FAIL` (no other failure uses it), its status completes, and the worker goes on. - `a status entry is still pending` now lists the reads running longest: age, worker (`dstorage N`), file, offset, options. A read running for seconds on a live worker is a stalled read (for example a `pread` that never returns), not a panic. ## How it was tested - [x] `cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory`: 395 passed. Native `cargo test -p victory-hle`: 150 passed. `null_out_pointers_fail_without_leaking_lanes_or_handles` fails about 1 run in 10, on main too (12 of 100): it compares the scheduler's global `next_id` while other tests create queues. - New: `a_panicking_request_fails_its_status_and_the_queue_goes_on`, `a_worker_survives_a_panic` (both fail on main: "never completed"), `running_reads_name_what_they_read`, `an_unsupported_source_is_not_read_for_its_name` (the names in the warning and the failure line never read the source of a request `execute` refuses). A `#[cfg(test)]` tag makes a request panic; release builds are unchanged apart from the catch. - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings`: passes, also with `--all-features`. - [x] Ran the game, or not needed: not needed. ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md (none) - [x] New diagnostics are behind a `VICTORY_*` variable and documented (none new; the existing warning gains a field)
Olima34 commented 2026-11-28 01:32:37 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:32:37Z.

Review: APPROVED


Check report (helping the maintainer clear the queue):

  • CI: check and macos-scripts green on 8d0d64d3.
  • Read: the whole diff. catch_unwind around execute turns a panicking request into E_FAIL, so its status entry completes, the worker survives and its staging is given back (the release profile unwinds, so this holds in a real build too). The pending warning now names the reads running longest. source_name no longer reads a source an unsupported option makes foreign. Tests for each: a_panicking_request_fails_its_status_and_the_queue_goes_on, a_worker_survives_a_panic, running_reads_name_what_they_read, an_unsupported_source_is_not_read_for_its_name. Docs updated.
  • Local check on current main (226645f9) merged with this PR, #499 and #507: victory-hle tests pass on x86_64-apple-darwin (336 + 17), Windows clippy (-D warnings) clean, cargo xtask policy ok.
  • Nit, not blocking: the old doc line of execute ("Reads, inflates and/or unpacks, and writes one request.") now sits above failed instead.
  • Not checked: no game run (the maintainer asked us to work on GitHub only).

Thanks @lautarocherro!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6094912515 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/454#pullrequestreview-6094912515). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-28T01:32:37Z. **Review:** APPROVED --- Check report (helping the maintainer clear the queue): - **CI:** `check` and `macos-scripts` green on 8d0d64d3. - **Read:** the whole diff. `catch_unwind` around `execute` turns a panicking request into `E_FAIL`, so its status entry completes, the worker survives and its staging is given back (the release profile unwinds, so this holds in a real build too). The pending warning now names the reads running longest. `source_name` no longer reads a source an unsupported option makes foreign. Tests for each: `a_panicking_request_fails_its_status_and_the_queue_goes_on`, `a_worker_survives_a_panic`, `running_reads_name_what_they_read`, `an_unsupported_source_is_not_read_for_its_name`. Docs updated. - **Local check on current main (226645f9) merged with this PR, #499 and #507:** `victory-hle` tests pass on x86_64-apple-darwin (336 + 17), Windows clippy (`-D warnings`) clean, `cargo xtask policy` ok. - **Nit, not blocking:** the old doc line of `execute` ("Reads, inflates and/or unpacks, and writes one request.") now sits above `failed` instead. - **Not checked:** no game run (the maintainer asked us to work on GitHub only). Thanks @lautarocherro!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS!454
No description provided.