Skip to content
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

Unable to detect what resources used WaitFor #5558

Closed
1 task done
afscrome opened this issue Sep 5, 2024 · 5 comments
Closed
1 task done

Unable to detect what resources used WaitFor #5558

afscrome opened this issue Sep 5, 2024 · 5 comments
Assignees
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Milestone

Comments

@afscrome
Copy link
Contributor

afscrome commented Sep 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

The WaitOn implementation in main doesn't seem to leave behind any observable marker of it's use on the resource.

It would be helpful if there was a way to interrogate which resources make use of WaitFor. For example in a BeforeStartEvent, find all resources with .WaitFor(db) and add an additional .WaitFor(migrator)

Describe the solution you'd like

I'd like some way to find out from an IResource that had WaitFor configured - likely through some kind of annotation.

Additional context

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Sep 5, 2024
@davidfowl
Copy link
Member

cc @mitchdenny

@davidfowl davidfowl changed the title Unable to detect what resources used WaitOn Unable to detect what resources used WaitFor Sep 5, 2024
@davidfowl davidfowl added this to the 9.0 milestone Sep 5, 2024
@mitchdenny
Copy link
Member

With the implementation of WaitFor in main we avoided introducing another annotation and instead just made use of the event subscriptions. The downside of this is that we don't have a lot of introspection ability which could be useful.

An example of where it could be useful is where we might want to redirect health check error details in logs to dependent resources to make the cause of a resource in a Waiting state more useful.

I'm contemplating introducing a WaitForAnnotation or a DependencyAnnotation and storing a reference to the subscription on it. Alternatively, @JamesNK was introducing a relationship annotation in #5311 (but has other priorities right now).

I think this is a good suggestion no matter which way we tackle it.

@mitchdenny
Copy link
Member

I'll work on this after #5515 merges in.

@mitchdenny
Copy link
Member

#5842 should address this issue. As part of the PR we add some additional logging to make it clear when a dependent resource has finished waiting. Additionally the eventing hookup has been changed so that the waits occur concurrently so you'll see log entries for all dependency resources.

@mitchdenny
Copy link
Member

Fixed in #5842 but wasn't closed automatically. /cc @afscrome

@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

No branches or pull requests

3 participants