ConduitPlatform / Conduit

Batteries-included backend that works with any stack.

Home Page:https://getconduit.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Race condition between Config module and module configuration requests

kon14 opened this issue · comments

Describe the bug

The Config module currently expects any configurable modules being brought up, or at the very least attempt communication, after Database so that the Config schema can be registered and the module service becoming functional before any incoming requests make their way through gRPC.

This is especially a problem for modules expecting to migrate their configuration early in their initialization.

To Reproduce
Steps to reproduce the behavior:

  1. Bring up Core
  2. Start Authentication
  3. Start Database
  4. Notice errors (eg No database instance provided! as a result of uninitialized Config model singleton)

Expected behavior
Config should probably be caching early configuration requests and performing them once ready(?)
Otherwise, Conduit's initialization will have to be reworked so that Config is becomes serviceable before modules get a chance to communicate with it.

This is going to require certain changes to Conduit's initialization, proper gRPC health checks (#29) are going to be required for grpc-sdk to handle this efficiently.

I'm currently looking into how best to implement this.
Database introspection (#77) is also an important consideration.