You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Graceful shutdown takes ~3sec while sometimes it is unnecessary to wait, this improves UX by allowing second Control+C (or shutdown signal) to immediately force close server:
^C
Shutting down server in 3s... (press Ctrl+C again to force close)^C <-- second time
Force closing...
``
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved server graceful shutdown behavior with enhanced force-close operation handling.
* Added ability to force-close the server during shutdown using Ctrl+C keyboard shortcut.
* Enhanced shutdown messages to provide clearer instructions about forcing server closure when necessary.
<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Enhanced graceful shutdown mechanism in src/_plugins.ts by introducing a force-close callback variable. Implemented re-entrant shutdown handling and force-close timeout logic. Improved user messaging to include Ctrl+C force-close instruction. Changes enable immediate shutdown on subsequent invocations.
Added forceClose callback variable to manage immediate force-close path. Implemented re-entrant shutdown handling that invokes forceClose on subsequent shutdown calls. Enhanced shutdown start message with Ctrl+C instruction. Added force-close implementation that clears timeout, logs progress, calls server.close(true), and resolves promise. Configured force-close to trigger after graceful shutdown timeout expires.
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
🐰 A hop through the shutdown, so graceful and grand, With force-close awaiting, we've got it all planned, Press Ctrl+C swift, if you cannot wait long, The rabbits say "close!" and the server goes strong! No more hanging 'round—just clean exits, my friend, A powerful finale... The End. 🎬
✨ Finishing touches
📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Graceful shutdown takes ~3sec while sometimes it is unnecessary to wait, this improves UX by allowing second Control+C (or shutdown signal) to immediately force close server: