Repository navigation
fix: synchronize status pipe shutdown - #11
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Synchronizes the status worker's final shutdown check and pipe-instance creation with the shutdown request. The mutex is released before ConnectNamedPipe; shutdown sets its flag under the same mutex and wakes afterward. Failed-startup cleanup also wakes status when its ready ACK is still queued.
Adds a process-isolated regression that observes actual mutex contention, verifies worker/UI joins and endpoint cleanup, and preserves failure after any rescue connection. Test hooks compile only under cfg(test).
Base: main at 1b95562. Local head: f639b56. Two files changed. PR10 remains a separate draft diagnostic.
Why
Shutdown could attempt its only wake while no status instance existed, then join a worker that created its next pipe and waited indefinitely for a client. The exact final regression fails on the old main worker with ERROR_FILE_NOT_FOUND, requires an owned-fixture rescue, verifies cleanup and returns exit101. The corrected worker finishes without rescue. This reproduces a real defect; the historical CI stall's cause remains unproven.
How it was tested
Same final fixture on old and corrected workers, unique inert endpoints and no protection runtime.
Safe Rust aggregate: 85 successful executions including one nested child; native Power Request acquisition test explicitly skipped.
Formatting check, strict Clippy all-targets/all-features and release MSVC build: offline/locked, passed.
Docs: 26 Markdown files passed; local anchors are not checked.
Smoke safety: seven preflight fixtures and cleanup checks passed with fake processes/tasks.
Release binary --help/--version passed with empty stderr and unchanged SHA256. No state-changing runtime smoke or physical/elevated acceptance was run locally.
scripts/check.ps1 -Mode Full passes for Rust changes (or -Mode Docs for docs only). Full was not run locally because it includes a real Power Request test; its safe components above passed.
tests/developer_checks.ps1 if developer tooling changed: not applicable; tooling unchanged.
tests/smoke_safety.ps1 passes.
Relevant smoke/manual checks run in an isolated environment, or skips explained above.
Docs updated if behavior changed: existing contract restored, no contract change.
Checklist