-
Notifications
You must be signed in to change notification settings - Fork 747
EndpointReference evaluation should wait on missing AllocatedEndpoint #13074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13074Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13074" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where EndpointReference evaluation would return null immediately when an AllocatedEndpoint for a specific network context was missing, instead of properly waiting for it to be allocated. The fix ensures that a ValueSnapshot is created and added to the collection for the missing network context, so that the evaluation will wait (as intended) until the endpoint is allocated.
Key Changes:
- Modified
EndpointReferenceExpression.GetValueAsync()to create a newNetworkEndpointSnapshotwith an emptyValueSnapshotwhen no snapshot exists for the requested network context, enabling proper waiting behavior - Added a test to verify that expression resolution waits (and times out) when an allocated endpoint for a specific network context is missing
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Hosting/ApplicationModel/EndpointReference.cs | Fixed the logic to create and add a NetworkEndpointSnapshot with an empty ValueSnapshot when none exists for the network context, instead of returning null immediately |
| tests/Aspire.Hosting.Tests/ExpressionResolverTests.cs | Added test ExpressionResolutionShouldWaitOnMissingAllocatedEndpoint and helper class TestHostResource to verify the fix works correctly |
|
/backport to release/13.0 |
|
Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19548391113 |
|
@karolz-ms backporting to "release/13.0" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Patch format detection failed.
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
…#13074) * Expression resolver should wait on missing AllocatedEndpoint(s) * Target test now passing * ExpressionResolverTests passing
Fixes #12823
This was my mistake when implementing context-aware EndpointReference evaluation