Repository navigation
Prevent aspire doctor from orphaning DCP processes - #21837
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21837Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21837" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Only macOS ARM64 execution is reported, leaving platform-specific parent-exit monitoring, .NET 11 standard-handle inheritance, and cleanup behavior unvalidated on Windows and Linux.
No open issues 🎉
What changed in this PR
This PR ties aspire doctor’s short-lived DCP processes to the CLI process so they shut down after an abrupt CLI exit, without changing command options or diagnostic output.
Changes:
- Passes
--monitor <CLI PID>through the shared DCP launch path for both certificate modes. - Adds real-DCP regressions for abrupt parent exit and normal probe cleanup, with file-backed output to avoid broken-pipe false positives.
- Expands certificate, cancellation, and failure coverage, shares the certificate test helper, and restores the pinned native DCP package for tests.
| File | Description |
|---|---|
tests/Aspire.Cli.Tests/Utils/DcpConnectionLifetimeTests.cs |
Tests DCP shutdown after parent exit and normal probe completion. |
tests/Aspire.Cli.Tests/Utils/DcpConnectionHealthCheckTests.cs |
Adds monitor-argument, certificate, cancellation, and failure coverage. |
tests/Aspire.Cli.Tests/TestServices/TestCertificateManager.cs |
Extracts a shared certificate helper with configurable trust. |
tests/Aspire.Cli.Tests/TestServices/DcpConnectionTestProcess.cs |
Provides controlled real-DCP execution with persistent standard streams. |
tests/Aspire.Cli.Tests/Certificates/NativeCertificateToolRunnerTests.cs |
Reuses the shared certificate helper. |
tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj |
Restores native DCP and exposes its directory to tests. |
src/Aspire.Cli/Utils/EnvironmentChecker/DcpConnectionChecker.cs |
Adds CLI process monitoring to DCP connectivity probes. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
2d946e5 to
def5e8e
Compare
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This comment has been minimized.
This comment has been minimized.
9f24c03 to
e5595a5
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the test’s outer timeout may cause false failures on slow runners while startup and readiness remain within their individual limits.
No open issues 🎉
4 resolved since last review
Review effort: Max
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Consolidate the fake DCP API server into the shared test service and pass the temporary storage required by main's centralized allocation. Co-authored-by: Copilot App <[email protected]>
192e1fb to
c2ef1ea
Compare
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <[email protected]>
Tests selector4 / 101 PR test projects · 6 PR jobs, from 13 changed files. Selected PR test projects (4 / 101)
Selected PR jobs (6)
How these were chosen — grouped by what changed📦 affected project 📦 affected project 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
18e3cd4
into
main
|
✅ No documentation update needed. Skipped: proven false positive. Triggered signals:
|


Description
aspire doctorstarts short-lived DCP API servers to check connectivity. If the CLI exits abruptly, managed cleanup cannot run and those API servers and their controllers can outlive the command. Bind each probe's DCP lifetime to the executing CLI process so DCP shuts down when its owner exits.--monitor <CLI PID>through the common launch path for both certificate modes, preserving normal shutdown, cancellation, and error cleanup.The test project restores the repository-pinned native DCP package. Production dependency versions and shared process infrastructure are unchanged.
User-facing usage
Existing invocations and diagnostic output are unchanged:
The lifetime guard is automatic; it does not introduce a new Aspire CLI option.
Validation
Passed on macOS ARM64 with Podman selection: 53 passed, 1 existing Linux-only test skipped, 0 failed.
git diff --checkpassed.NU1903warnings for the repository-pinned ILCompiler; no SDK or dependency version was changed to suppress those unrelated warnings.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?