-
Couldn't load subscription status.
- Fork 130
Fix blocking ParameterResource.Value calls to prevent deadlocks in Aspire 9.4+ #763
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
Co-authored-by: aaronpowell <[email protected]>
Co-authored-by: aaronpowell <[email protected]>
|
@davidfowl is this looking like the right direction for a starting point? I assume that we'll need to have this updated for use 9.4 before the code will compile |
|
@copilot cast the ParameterResource instance to IValueProvider and then call GetValueAsync on it. |
Co-authored-by: davidfowl <[email protected]>
Applied the IValueProvider cast pattern as requested. Updated ActiveMQ health check and all test assertions to use Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@aaronpowell should be doable without referencing 9.4 |
Cool - wasn't sure if it was an API added to 9.4. |
|
It was but there's a way to go async pre 9.4 as well, at least in the calling pattern. |
src/CommunityToolkit.Aspire.Hosting.Minio/MinioBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Minio/MinioBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Redis.Extensions/RedisBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Redis.Extensions/RedisBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/PostgresBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot revert that last change |
Co-authored-by: aaronpowell <[email protected]>
Minimum allowed line rate is |
This PR addresses blocking calls to
ParameterResource.Valuethat can cause deadlocks in Aspire 9.4+ due to changes in dotnet/aspire#10354.Problem
The recent changes in dotnet/aspire require migrating from synchronous
ParameterResource.Valuecalls to the asynchronousIValueProvider.GetValueAsyncAPI. Blocking calls to.Value, especially in asynchronous pipeline methods, risk deadlocking or blocking app host startup.Solution
Primary Fixes (DbGate Integration):
.Valuecalls with deferred parameter resolution by passingParameterResourceinstances directly to environment variablesFiles Changed:
src/CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions/PostgresBuilderExtensions.cssrc/CommunityToolkit.Aspire.Hosting.SqlServer.Extensions/SqlServerBuilderExtensions.cssrc/CommunityToolkit.Aspire.Hosting.MySql.Extensions/MySqlBuilderExtensions.cssrc/CommunityToolkit.Aspire.Hosting.Redis.Extensions/RedisBuilderExtensions.csAdditional Fixes:
GetValueAsyncExample of the fix:
Outstanding Issues
Some configurations (Adminer JSON serialization, Dapr metadata) still use blocking calls due to architectural constraints requiring immediate string values in synchronous environment callbacks. These are documented for future investigation but are beyond the scope of the original issue which focused on async pipeline methods.
Fixes #751.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.