Repository navigation
fix(server): queue follow-up restart if requested during in-flight restart (fix #23392) - #23396
santusht06 wants to merge 1 commit into
Conversation
|
This PR has been automatically flagged as likely to be created by a bot, LLM, or agent, and will be automatically closed. These contributions harm the maintenance of the project. Please read our AI policy for more information. If you believe this is a mistake, please reply to this comment and we will review it. |
|
Hi maintainers, This is a legitimate manual fix. I investigated #23392, reproduced the race condition with the author's reproduction repo ( The fix uses a Please let me know if any changes are needed. |
Description
fixes #23392
When a config/env change lands while
restartServeris in flight (e.g. fast consecutive edits or switching branches withgit checkout),server.restart()returns the active_restartPromisedirectly without scheduling a follow-up restart once the current one completes. As a result, the server stays running the previous config snapshot.This PR adds an internal
_pendingRestartflag toserver.restart()so that if another restart request arrives while a restart is in flight,restartServerloops until no pending requests remain before resolving the promise.Added a test case in
hooks.spec.tscovering concurrentserver.restart()calls.