Windows PID reuse can hang resource shutdown
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- cli, operating-systems
Research direction
The bug is in pkg/process/process_util.go in the GetProcessTree function. Start by examining how process relationships are enumerated on Windows. Look for where parent-child links are established and add checks for process creation times to detect stale parents. Implement a visited set to prevent cycles. Test by simulating PID reuse on Windows, perhaps using the reproduction steps from the linked Aspire issue.
Written by the indexing model from the issue text.
Description
Problem
DCP can get stuck while stopping a process on Windows. If Windows reuses a PID, an older process can still list that number as its parent. This can create a circular relationship when DCP looks up descendants.
GetProcessTree does not check for stale parent relationships or previously visited processes, so it keeps following the cycle until shutdown times out.
Reproduction
Reproduced with DCP 0.26.2 on Windows x64 by repeatedly stopping, starting, and restarting an Aspire worker. Restart failed on cycle 12; the other two runners completed 30 cycles each.
The captured process identities show the cycle. The shutdown helper used roughly one CPU core until its 15-second deadline expired, and the CLI returned exit code 16.
Failing CI job · Captured diagnostics
Tracked in microsoft/aspire#20103.
Expected behavior
Process-tree traversal should terminate and include only valid descendants. Check process creation times to reject stale parent relationships, and guard against revisiting processes.
A cycle guard alone is insufficient: it could still leave unrelated processes in the list to kill. No product fix has been applied yet.
- Dominant language
- Go
- Stars
- 190
- Forks
- 24
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 20
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/dcp
-
Add application iconOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/dcp#206 · 2 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 3 days
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 38/100
microsoft/dcp#179 · 2 comments · 23 reactions ·
Maintainers usually reply within 3 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 3 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
GoogleCloudPlatform/k8s-config-connector#13462 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
coder/coder#29955 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/TypeScript#64453 ·
Maintainers usually reply within 1 day
-
OpenAI-compatible endpoint: response ids have only 999 possible values (chatcmpl-rand.Intn(999))Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day