Skip to content

Windows PID reuse can hang resource shutdown #274

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions