Repository navigation
fix: contain a thread's Windows processes in a Job - #138
Merged
Merged
Conversation
…tics A job that cannot be made or assigned is kept as unavailable with its OS error, logged once, and listed by kg diagnostics export. Stop then ends only the program. Windows tests cover a grandchild under stop and drop, a forced assign failure, and finish settling a submit queued behind a program that never reads.
Gate test helpers that only Unix tests use, box the terminal in its Shown state, keep the Unix-only executable step, and find the grandchild by its parent pid instead of PowerShell output. Give the Windows capture timeout room to start its child.
The grandchild tests assert the job, check every ping, and a control test shows a console close alone leaves an own-console grandchild alive. Unavailable keeps the io::Error and the log names the pid. A core test checks live_containments for the program and an extra terminal. The clippy job uses its own rust-cache key, and ToolHelp moves to a Windows dev-dependency.
aorumbayev
added a commit
that referenced
this pull request
Nov 11, 2026
aorumbayev
added a commit
that referenced
this pull request
Nov 12, 2026
## What changed On Windows, an update started the installer while kagan was still running. The installer cannot replace a running `kg.exe`, and the early start cut short kagan's quit handlers. Both Windows install paths (install at quit, and Restart and install) now start a hidden PowerShell waiter. It waits up to 120 seconds for kagan's process to end, then runs the setup with `/P`, or `/P /R` to open kagan again. - `windows_setup` in `crates/core/src/update/install.rs` builds the waiter. Its inputs come through `KAGAN_UPDATE_*` variables set on the waiter only, so no `KG_` variable reaches kagan's children. - Tests check the waiter's program, process id, setup path and flags on every OS. - `docs/behaviour.md` (Update) and decision 270 describe it. Size ceiling: 82758 (+66), with a Cost line. ## Root cause: likely, not proven Starting the installer during quit is the likely cause. The live proof is missing: in the test VM, windows did not show up in the test session, so I could not watch a real relaunch. The person will confirm with the next release. ## Checked and ruled out - The Job Object change (#138) only wraps thread programs, not kagan itself. - `KG_NO_START` is set only in tests. - A wait inside `lock_data_dir` was rejected, because it would delay every app start. ## Gate - `cargo fmt --check`, `cargo clippy --workspace --all-targets --locked -- -D warnings`, `cargo t --workspace --locked --no-fail-fast` (2305 passed). - `scripts/decisions-check.sh`, `glossary-check.sh`, `crate-boundaries.sh`, `test-env-check.sh`, `size-budget.sh`.
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.
Ends a thread's Windows processes with a Job Object that the program joins right after the pty starts it, and makes failure visible.
Tree(macOS and Linux),Job, orUnavailablewith the OS error. A failed job is no longer dropped by.ok(). It is logged once with its pid and listed bykg diagnostics export. Stop then ends only the program.