Move resource creation in ResourceReadyEvent event#7211
Merged
Conversation
davidfowl
reviewed
Jan 22, 2025
Member
|
This looks more like what I expect. But maybe thinking about it more .... not considering the resource to be "healthy" until the database is created might be the right thing to do.... |
Contributor
|
We can do that as a follow up to this #7163 |
davidfowl
approved these changes
Jan 23, 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
I am testing the new
ResourceReadyEvent. However there is a limitation in this case, I would still prefer the previous solution. Resource creation (db, containers) needs to happen when the emulator is "ready". But dependents should not use cosmosdb until the resources are created.The previous solution was relying on a custom healthcheck to create and assess the db/containers are created and/or ready. This new solution is hitting a deadlock, that is the
ResourceReadyEventis triggered once the resource si healthy, but if the healthcheck ensure the db/containers are available then it can't work sinceResourceReadyEventis doing it. So right now no db/containers are passed in the healthcheck, so it will only ensure the service is available beforeResourceReadyEventcan create the db/containers.Checklist
<remarks />and<code />elements on your triple slash comments?breaking-changetemplate):doc-ideatemplate):