Bound AppHost auxiliary backchannel handshake - #19832
Open
Adam Ratzman (adamint) wants to merge 2 commits into
Open
Bound AppHost auxiliary backchannel handshake#19832Adam Ratzman (adamint) wants to merge 2 commits into
Adam Ratzman (adamint) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adam Ratzman (adamint)
requested review from
James Newton-King (JamesNK),
David Fowler (davidfowl) and
Mitch Denny (mitchdenny)
as code owners
August 31, 2026 23:27
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19832Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19832" |
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
What changed in this PR
Bounds AppHost auxiliary backchannel handshakes to prevent CLI commands hanging on unresponsive AppHosts.
Changes:
- Adds a shared 10-second handshake deadline.
- Disposes failed JSON-RPC connections and observes deferred faults.
- Tests timeout and disconnection for both handshake RPCs.
| File | Description |
|---|---|
src/Aspire.Cli/Backchannel/AppHostAuxiliaryBackchannel.cs |
Enforces and cleans up timed-out handshakes. |
tests/Aspire.Cli.Tests/Backchannel/AppHostAuxiliaryBackchannelTests.cs |
Covers stalled handshake methods and connection disposal. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Ella Hathaway (ellahathaway)
approved these changes
Sep 1, 2026
Ella Hathaway (ellahathaway)
left a comment
Contributor
There was a problem hiding this comment.
I reviewed the bounded auxiliary-backchannel handshake, including cancellation, timeout enforcement, failure cleanup, both caller paths, and regression coverage. I didn’t find any issues to call out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
An AppHost that accepts its auxiliary socket but never answers JSON-RPC can no longer hang
aspire run,aspire ps,aspire stop, or other backchannel-scanning commands indefinitely.This adds a 10-second deadline around the shared AppHost information/capabilities handshake. The deadline is enforced locally even when the remote AppHost ignores RPC cancellation, and failed initialization now disposes
JsonRpcand its owned stream/socket before returning the failure to the existing caller flow.The tests cover an AppHost that stalls during either handshake RPC and verify that the client both times out and closes the connection. The separate issue where
CliOrphanDetectorallowed the original AppHost to survive is not changed here.User-facing behavior
Commands such as:
now stop waiting for an unresponsive AppHost handshake after 10 seconds instead of hanging indefinitely.
Validation:
AppHostAuxiliaryBackchannelTests: 7 passedAspire.Cli.Tests: 5,482 passed, 35 skippedFixes #19269
Checklist
<remarks />and<code />elements on your triple slash comments?