Allow start command to force waiting resources to start#7312
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (1)
- playground/Stress/Stress.AppHost/Program.cs: Evaluated as low risk
Comments suppressed due to low confidence (3)
src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs:214
- The new behavior introduced by the changes, especially the handling of waiting resources, is not covered by tests. Functional tests need to be added to ensure the correctness of the new logic.
public async Task StartResourceAsync(string resourceName, CancellationToken cancellationToken)
src/Aspire.Hosting/Dcp/DcpExecutor.cs:1620
- [nitpick] The variable name 'appResource' is ambiguous. It should be renamed to 'resourceReference' to match the method parameter.
var appResource = (AppResource)resourceReference;
src/Aspire.Hosting/Dcp/DcpExecutor.cs:1634
- The use of ConcurrentDictionary for _startingResourceState should be reviewed for thread safety, particularly around the WaitForDependenciesTask and WaitCancellation properties.
throw new InvalidOperationException($"Unexpected resource type: {appResource.DcpResource.GetType().FullName}");
davidfowl
reviewed
Jan 29, 2025
davidfowl
approved these changes
Jan 29, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Addresses #5879
This PR makes it possible to force waiting resources to start. The important thing to consider here is waiting resources are already trying to start and they're waiting on
BeforeResourceStartedEventto finish.I'm not happy about thread safety here. Suggestions welcome.TODO:
Checklist
<remarks />and<code />elements on your triple slash comments?breaking-changetemplate):doc-ideatemplate):