Skip to content

Fix Windows job breakaway for detached DCP processes - #232

Merged
Karol Zadora-Przylecki (karolz-ms) merged 1 commit into
mainfrom
danegsta-fix-detached-job-breakaway
Aug 12, 2026
Merged

Fix Windows job breakaway for detached DCP processes#232
Karol Zadora-Przylecki (karolz-ms) merged 1 commit into
mainfrom
danegsta-fix-detached-job-breakaway

Conversation

@danegsta

Copy link
Copy Markdown
Member

Detached DCP servers launched by Aspire on Windows inherit the CLI's KILL_ON_JOB_CLOSE job. When the CLI exits, Windows can terminate DCP before parent-monitor cleanup runs, leaving session resources behind.

This change queries the current process's immediate job instead of a newly created empty job, then applies CREATE_BREAKAWAY_FROM_JOB when that job permits breakaway. A Windows regression test assigns a helper process to a BREAKAWAY_OK job and verifies that detached children receive the breakaway creation flag.

Testing

  • make test
  • make lint

Related: microsoft/aspire#19250

Query the current process job before adding CREATE_BREAKAWAY_FROM_JOB, and cover the behavior with a Windows job-object regression test.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd8de039-355b-420e-b760-fa6bd6239120

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.

Pull request overview

Fixes Windows detached DCP processes being terminated with Aspire’s CLI job, addressing cleanup failures related to microsoft/aspire#19250.

Changes:

  • Queries the current process’s immediate Windows job for breakaway permission.
  • Adds a regression test validating CREATE_BREAKAWAY_FROM_JOB.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/process/process_util_windows.go Detects breakaway permission on the current job.
pkg/process/process_windows_test.go Tests breakaway flag configuration using a helper process.

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

@danegsta

Copy link
Copy Markdown
Member Author

Tested a local build with the latest 13.5.0 staging CLI build and confirmed it resolved the issue.

@karolz-ms
Karol Zadora-Przylecki (karolz-ms) merged commit b5500f1 into main Aug 12, 2026
13 checks passed
@karolz-ms
Karol Zadora-Przylecki (karolz-ms) deleted the danegsta-fix-detached-job-breakaway branch August 12, 2026 03:50
@karolz-ms

Copy link
Copy Markdown
Collaborator

/backport to release/0.25

@github-actions

Copy link
Copy Markdown

Started backporting to release/0.25: https://github.com/microsoft/dcp/actions/runs/31561382278

@github-actions

Copy link
Copy Markdown

Karol Zadora-Przylecki (@karolz-ms) backport PR couldn't be created automatically, please create the backport PR manually!

Open backport PR into release/0.25.

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.

3 participants