Use explicit startup/shutdown order for development servers #5459
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.
What changed?
Instead of starting all services in one process in parallel, serialize the startup in a defined order, and the shutdown in the reverse order.
Why?
This reduces noisy error logs during both startup and shutdown.
I originally thought that serializing startup would be vulnerable to the problem fixed in #3100 but I couldn't reproduce it after a bunch of testing, so I think some other change in between must have also addressed that. If that problem reappears, though, an easy fix would be to start matching and history at the same time, and wait for them before moving on to frontend.
How did you test it?
local server startup/shutdown
Potential risks
Generally multiple services in one process is only used in development, so this shouldn't have any effect on production.