-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): remove restart guard on restart #13789
Conversation
Run & review this pull request in StackBlitz Codeflow. |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
Oh, I didn't see this one. I think it is ok to merge this PR to fix the edge case after #13262. We may still want a init guard that prevents restarts while the server is starting (so it also works on server starts), but that could be done in another PR if we think it is justified. |
BTW. This or something else may trigger a weird restart loop in watch mode. For me, it happens too, but stops after 3-5 retries. |
Reverting Vite version all the way to 4.3.9 prevents it from happening. It just gets into it 2-3 times and then stops. Next time I run |
If it's happening in 4.3.9 too, it's likely not quite related to this PR. I'd suggest removing your Vite plugins one by one to figure out which is touching the env files or vite config files that causes the restart. Otherwise a quick workaround for now is to configure |
@bluwy probably. Maybe it's a Sentry plugin. I'll look into it later. But for now, somehow 4.3.9 still fixed it for everyone. Thanks for the hint 🫡 |
Yeah, it's |
Description
fix #13735
On server restart, we assign the
_restartPromise
of the old server to the new server to prevent the new server'srestart()
from working (to prevent chaos like port collision, proper server listen/teardown). This was done in #7004 (the guard)However, #13262 uses
_restartPromise
for another purpose -- throw on outdated request. That means there's a short interim during server listen that_restartPromise
exist as a guard, but the server isn't actually outdated.#13735 showed an edge case in SvelteKit where it calls
ssrLoadModule
in this interim causing it to falsely error.This PR removes that guard as I don't think it's useful? On initial server startup we aren't guarding it either.
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).