Open
Conversation
…SManager into feat/daemon-shutdown-2
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces improvements to the shutdown logic of the daemon, allowing for a "soft exit" mode that gracefully shuts down non-Docker instances while skipping Docker instances. This enhances the shutdown process by providing a safer, less disruptive way to stop services unless a forceful shutdown is required. Additionally, there are minor code style and import order adjustments.
Shutdown logic improvements:
softExitmethod toInstanceSubsystemthat skips Docker instances and attempts a soft shutdown of general instances. If instances take too long to stop, they are forcefully closed after a timeout.app.tsto use the new soft exit logic by default when receiving process signals or the "exit" command, only performing a forceful exit if necessary. [1] [2]Minor code improvements:
app.tsfor consistency. [1] [2]已知问题:在某些 Linux 环境下,直接在前台按 Ctrl+C 无法正常触发对非 Docker 实例的软关闭(可能与终端、systemd 或容器化运行时的信号传播有关,systemd更改KillMode=process可正常运关闭)。