fix(core): gracefully stop FXServer child on shutdown signals#21
Merged
Conversation
Maximus7474
reviewed
Jun 29, 2026
Maximus7474
approved these changes
Jun 29, 2026
Collaborator
|
As @andreutu says: LGTM |
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.

Description
Previously the core only spawned and managed the FXServer child but never handled its own termination. On
SIGTERM(docker stop, systemd, etc) orSIGINT(Ctrl+C), the panel process was killed immediately and the spawned FXServer was left to be torn down abruptly rather than stopped cleanly.This adds
SIGTERM/SIGINThandlers inapps/core/src/index.tsthat:ProcessManager.stop()to stop the running FXServer child,process.exit(0),shuttingDownguard so a repeated/duplicate signal is a no-op.ProcessManager.onExitalready treats exit code143as a clean stop, so no spurious "crashed" state is reported.Tests
Additional Notes
Verified by building the Linux target and running the production binary in a container, with the server in the
runningstate:docker stop): child stopped gracefully (pm.stop()ran), panel exited with code 0 in rougly 2-3 seconds.docker kill -s SIGINT): same clean shutdown, exit code 0.