Skip to content

fix(rust): allow explicit Windows job breakaway - #2848

Open
dibarbet wants to merge 3 commits into
mainfrom
dibarbet-sdk-process-breakaway
Open

dibarbet wants to merge 3 commits into
mainfrom
dibarbet-sdk-process-breakaway

Conversation

@dibarbet

@dibarbet dibarbet commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary

  • Allow descendants of Rust SDK-owned CLI processes to explicitly leave the Windows Job Object using CREATE_BREAKAWAY_FROM_JOB.
  • Preserve JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE and ordinary descendant ownership; do not enable silent breakaway or change suspended launch/assignment.
  • Clarify that explicitly escaped descendants can survive SDK-owned job cleanup.

This is limited to the Rust SDK job policy. CLI/runtime launch changes and process-group cleanup in the other SDKs are separate work. Restrictive enclosing jobs remain authoritative, and Node's detached: true is not equivalent to explicit Win32 job breakaway.

Validation

  • Windows process-tree unit tests: 9 passed.
  • Existing Windows process-tree lifecycle tests: 5 passed.
  • Native Windows probes verified ordinary-child cleanup and an explicitly escaped TCP service remaining responsive after job termination. These are investigation probes, not a checked-in regression or confirmation of the application's runtime launch call site.
  • Pinned nightly Rust formatting and git diff --check passed.

dibarbet and others added 2 commits October 15, 2026 13:16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d460b2a4-7884-479b-842d-ccffc549a94d
Preserve upstream's Windows launch fallback documentation alongside the explicit job-breakaway guarantee.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d460b2a4-7884-479b-842d-ccffc549a94d
@dibarbet
dibarbet marked this pull request as ready for review October 15, 2026 21:44
@dibarbet
dibarbet requested a review from a team as a code owner October 15, 2026 21:44
Copilot AI max review requested due to automatic review settings October 15, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new breakaway policy lacks checked-in regression coverage, leaving nested-job cleanup behavior unverified.

1 open finding
What changed in this PR

Updates the Rust SDK’s Windows Job policy to allow explicit descendant breakaway.

Changes:

  • Enable explicit breakaway while preserving kill-on-close and ordinary descendant ownership.
  • Document that escaped descendants can survive SDK cleanup.
File Description
rust/​src/​process_tree.rs Adds JOB_OBJECT_LIMIT_BREAKAWAY_OK to the Job policy.
rust/​README.md Clarifies escaped-descendant lifetime.

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rust/src/process_tree.rs
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d460b2a4-7884-479b-842d-ccffc549a94d

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants