Commit 67350fe
committed
feat(server): add graceful shutdown handling for SIGTERM and SIGINT
- Add signal handling for SIGTERM and SIGINT with context cancellation
- Implement cleanup function with detailed logging for shutdown events
- Log server startup and shutdown signals with version information
- Use context-aware StdioServer for graceful shutdown support
- Ensure database connections are properly closed on termination
This makes the server Docker/Kubernetes friendly and prevents connection leaks
during shutdown.
Implements #381 parent 73a95bc commit 67350fe
1 file changed
+28
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
703 | | - | |
704 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
705 | 708 | | |
706 | 709 | | |
| 710 | + | |
| 711 | + | |
707 | 712 | | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
708 | 728 | | |
709 | 729 | | |
710 | 730 | | |
711 | | - | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
712 | 737 | | |
713 | 738 | | |
714 | 739 | | |
| |||
0 commit comments