fix: early return on closed server only for warmup #16216
Closed
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
@cpojer reported he is experiencing a server crash when switching branches. It seems it is because of closed server error we throw to do an early return while restarting the server.
More info in this thread https://discord.com/channels/804011606160703521/1213652176707264552/1219521412692185158.
It is hard to do a minimal repro here, but he can reproduce it consistently for certain branches that differ in the config file, so a server restart is triggered.
This PR removes throwing as a mechanism for doing the shortcircuit and instead does an early return only for warmup requests. Restarting the server may be slightly slower as more request processing are going to complete their way through the pipeline, but I don't think there will be a significant diff. It is still important to avoid processing warmup requests as these could be piling up in the server due to the eager crawling of static imports.
What is the purpose of this pull request?