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

Allow the ResourceReadyEvent to block waiters #7163

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

davidfowl
Copy link
Member

@davidfowl davidfowl commented Jan 20, 2025

Description

When trying to write code that runs after a resource becomes healthy but before waiters are unblocked it requires complex coordination and a deep understanding of the resource lifecycle. This defaults to blocking waiters until the event is ready, allows users to build pretty nice experiences without complex coordination logic across resources.

Fixes #7164

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

- This allows more easier coordination after a resource is healthy but before waiters are unblocked. This is useful for seeding etc.
@davidfowl
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

- Don't rely on IsCompleted for the event update.
@davidfowl
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sebastienros
Copy link
Member

runs after a resource becomes healthy but before waiters are unblocked

This is the reason I had to use a health check to seed the containers/dbs in the event hub host integration. With that I could move the logic there and use the standard health check.

@davidfowl
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidfowl
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidfowl
Copy link
Member Author

I'm led to believe that this PR is either causing problems with these tests or exposing flakiness somewhere.

@davidfowl davidfowl merged commit facc75f into main Jan 22, 2025
9 checks passed
@davidfowl davidfowl deleted the davidfowl/block-consumers-onready branch January 22, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants