bug: Adding a schema within a repository followed by other imports could result in failures due to timing issues #5051
Labels
group/backend
Issue related to the backend (API Server, Git Agent)
priority/1
This issue must be fixed/implemented ASAP, it's a blocker for a release
type/bug
Something isn't working as expected
Milestone
Component
Git Integration
Infrahub version
v1.1.0b1
Current Behavior
When importing a repository that includes a schema along with other objects such as GraphQL queries, transforms / generators there's a chance that a timing issue causes problems for the objects created after the schema has loaded.
This is because when calling the method below to load the schema we don't wait for the schema to converge after moving forward with the other imports.
The result could potentially be that when we try to import a GraphQL query the request hits one of the HTTP workers where the schema hasn't yet been updated which would result to an error due to an invalid GraphQL query (since the new nodes might not yet exist)
Expected Behavior
The schema importer needs to wait until the schema has converged across all active workers before continuing.
Steps to Reproduce
I have not seen this error myself but thinking about it it seems reasonable that it could lead to an error. As such it might be hard to reproduce. It would involve adding a fairly large schema (that might take some time to load on the secondary workers) and then import a few objects directly after this. There is of course a chance that the request hits the same worker as the one that processed the schema (where it is already updated)
Additional Information
No response
The text was updated successfully, but these errors were encountered: