-
Notifications
You must be signed in to change notification settings - Fork 668
feat(core-mcp-server): handle SIGTERM #805
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens without the SIGTERM
or SIGINT
?
Forgive me, I see the PR comment |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #805 +/- ##
==========================================
+ Coverage 88.76% 88.77% +0.01%
==========================================
Files 560 566 +6
Lines 38754 38885 +131
Branches 5994 6013 +19
==========================================
+ Hits 34399 34520 +121
- Misses 2819 2826 +7
- Partials 1536 1539 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
842c890
to
0e1359a
Compare
0e1359a
to
e329b3e
Compare
@mrlikl Can we have signal.SIGHUP event? If user close terminal window(e.g. iTerm or Terminal app), the signal come with SIGHUP. |
@stevenshim I added the change, thank you for the suggestion |
Summary
Changes
This PR adds signal handling for SIGTERM and SIGINT to the MCP core server, enabling graceful shutdown when the server receives termination signals.
User experience
Before: When the Q CLI exits, the MCP container server is left orphaned.
After: The server now handles termination signals properly, logging shutdown events and exiting cleanly. This ensures no lingering containers when the Q CLI exits.
Tested by building the container locally with a different tag, and adding this to q's mcp.json, when q exits, the core server container is shut down.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change? No
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.