Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
distsql: initialize the flow scheduler earlier
In 38dbeae we broke up the creation of the flow scheduler in order to give access to it to the status server. That required separating out initialization of the flow metrics into a separate step that is performed after the flow scheduler is created. However, as it turns out, it is possible that the DistSQL server receives some RPC calls before it is `Start`ed (the place where we put the metrics initialization). This can happen because the DistSQL server is registered as a gRPC service once it is created, and if an RPC comes in before the server is started, a NPE would currently occur. This commit fixes the issue by moving the initialization of the flow scheduler into the constructor of the DistSQL server (early enough to not race against incoming RPCs). Release note: None (no stable release with this bug)
- Loading branch information