Repository navigation
fix(client-state): let one slow identity helper use the whole lookup budget - #1400
Merged
Merged
Conversation
…budget The Electron Node host and the Tauri Rust host read a process's birth identity on Windows (and macOS) through a short-lived helper (PowerShell on Windows), with two attempts of five seconds each. Under heavy CPU contention a cold PowerShell start exceeds five seconds; both attempts time out, the host reports no identity, and cross-host election correctly fails closed, so the Node host never becomes primary. This is the intermittent Windows CI failure in client_state::cross_host::tests (cross_host.rs:1135 / :1068, about 10.4-11 s per failure), reproduced locally under controlled contention with real ETIMEDOUT results. Keep the same nominal ten-second total and the same two attempts, but share one deadline: a slow first helper may use the whole budget, and a retry only gets what remains. Identity semantics, the helpers and fail-closed behaviour on genuine failure are unchanged. This is a mitigation of slow cold starts, not a removal of the helper: extreme contention can still exceed the total budget. New tests cover a six-second cold helper succeeding, a retry receiving only the remaining budget, and budget exhaustion staying unavailable without starting another helper; they fail on the previous code. The cross_host Rust module passes 0/10 failures normally and 0/6 under moderate load; existing test bodies and assertions are unchanged.
Contributor
Author
|
The only failure is |
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.
Why
Intermittent Windows CI failure in
client_state::cross_host::tests(cross_host.rs:1135/:1068, ~10.4–11 s each, seen on #1362, #1363, #1369, #1397). The Node host reads its birth identity through PowerShell with two 5 s attempts; under heavy contention a cold PowerShell start exceeds 5 s, both attempts time out, election correctly fails closed and Node never becomes primary. Reproduced locally under controlled contention with realETIMEDOUT.Change
Same nominal 10 s total, same two attempts, but one shared deadline (Node
client-state-process-identity.ts, Rustcross_host.rscommand_value): a slow first helper can use the whole budget; a retry only gets the remainder. Identity semantics, helpers and fail-closed behaviour unchanged.This is a mitigation, not a removal of PowerShell: extreme contention can still exceed 10 s. (A native-API alternative was prototyped but not pursued.)
Validation
cross_hostRust module: 0/10 failures normal, 0/6 under moderate load; existing test bodies and assertions unchanged.