Repository navigation
[release/13.6] Keep DCP watches draining and close abandoned connections - #21002
Maddy Montaquila (maddymontaquila) merged 2 commits into
Conversation
(cherry picked from commit 785cf4c) Co-authored-by: Copilot App <[email protected]> Copilot-Session: d4e69fd0-651a-47cb-aeed-cff843f6aecc
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21002Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21002" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Core concurrency and response-lifetime changes require human sign-off, with transport-failure recovery still unresolved.
1 open finding
What changed in this PR
Backports DCP watch reliability improvements to release/13.6 without public API or dependency changes.
Changes:
- Explicitly owns watch responses and closes abandoned connections.
- Drains events independently while preserving ordering and five-minute reconnection.
- Adds parsing, retry, cancellation, and HTTP/2 regression coverage.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Tests/Dcp/KubernetesServiceTests.cs | Adds HTTP/2 watch reliability tests. |
| tests/Aspire.Hosting.Tests/Dcp/DcpApiServerCertificateFixture.cs | Supplies a shared test certificate. |
| src/Aspire.Hosting/Dcp/KubernetesService.cs | Buffers events independently of consumers. |
| src/Aspire.Hosting/Dcp/DcpPipelineBuilder.cs | Retries recoverable watch statuses. |
| src/Aspire.Hosting/Dcp/DcpKubernetesClient.cs | Owns responses and parses watch records. |
🧠 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. |
Co-authored-by: Copilot App <[email protected]> Copilot-Session: d4e69fd0-651a-47cb-aeed-cff843f6aecc
Tests selector50 / 99 PR test projects · 4 PR jobs, from 5 changed files. Selected PR test projects (50 / 99)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 show 45
🧪 📦 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. |
acea43f
into
release/13.6
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals: Exclusion reasons (from
This PR is a backport of #20972 onto |

Description
Backport of #20972 to release/13.6.
Aspire can leave a DCP watch open without an active reader when watch setup is canceled or resource handlers pause event consumption. An unread HTTP/2 watch can block DCP watcher publication and resource mutations, leaving resource operations stalled. This backport explicitly owns and closes watch responses and independently drains events without changing resource event ordering or lifecycle callback dispatch. The existing five-minute reconnection safeguard remains in place.
Related to #20609 and microsoft/dcp#286. These are client-side fixes, not a replacement for API-server slow-consumer handling. No dependency or public API changes.
Checklist
<remarks />and<code />elements on your triple slash comments?Customer Impact
Customers whose DCP watch setup is canceled or whose resource handlers stall event consumption can experience blocked resource updates and mutations. This fix keeps the watch reader draining and closes abandoned connections while preserving event ordering and lifecycle dispatch.
Testing
On the resolved release/13.6 implementation,
.\restore.cmdpassed. The following Windows run passed: 364 tests, 0 failures, 1 Linux-only platform skip. Coverage includes watch cancellation/disposal, paused consumers, ordering across reconnections, periodic restart, framing/malformed records, Status handling, retryable HTTP statuses, existing release timeout behavior, and DCP executor lifecycle behavior.Source-PR-only evidence: the original head passed 367 focused tests with one Windows platform skip, all PR checks, and Linux dogfood with concurrent restart rounds, exit-7 recovery, and mutations after more than five minutes idle. That dogfood was not repeated on this release branch; no local E2E tests were run.
Risk
Medium. No public API changes, but the fix changes core watch concurrency and HTTP response lifetimes. Lossless buffering preserves events; a persistently blocked handler can accumulate queued events instead of backpressuring DCP. Release-specific API timeout and create behavior are unchanged.
Regression?
Unknown — no specific regression introduction or affected release was established.