Fix: Add SIGTERM handler for graceful shutdown#96
Conversation
…child process leaks Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Consider making the signal handler idempotent (e.g., check if already set) to avoid potential issues if the module is reloaded. Otherwise, the change is clean and well-tested. Reviewed — quality: high |
|
Looks good, merging this in. CI is green and everything checks out 👍 Add SIGTERM handler for graceful shutdown on POSIX systems. |
Acknowledged. |
Good suggestion! I've updated the SIGTERM registration logic to be idempotent by checking |
…child process leaks Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
@shenald-dev this PR has merge conflicts with To resolve manually: Alternatively, you can try updating your branch with the latest from |
I've resolved the merge conflicts with |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
AI-assisted conflict resolution — merged changes from main into fix-sigterm-handler-4164478307985291345 (3-way merge with ancestor context)
|
@shenald-dev I went through the conflicts and resolved them — merged the changes from ⏳ CI needs to run on the new commits before merging. Will auto-merge on the next cycle if checks pass. 🔧 Used 3-way merge with ancestor context for more accurate resolution. 📦 A backup ref was created: Take a look and let me know if anything looks off 👍 |
Acknowledged. Thanks for resolving the conflicts! |
AI-assisted conflict resolution — merged changes from main into fix-sigterm-handler-4164478307985291345 (3-way merge with ancestor context)
|
@shenald-dev I went through the conflicts and resolved them — merged the changes from ⏳ CI needs to run on the new commits before merging. Will auto-merge on the next cycle if checks pass. 🔧 Used 3-way merge with ancestor context for more accurate resolution. 📦 A backup ref was created: Take a look and let me know if anything looks off 👍 |
Acknowledged. Thanks for resolving the conflicts! I've also merged the latest from |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
|
@shenald-dev this PR has merge conflicts with To resolve manually: Alternatively, you can try updating your branch with the latest from |
It looks like the conflicts were already successfully resolved by you, and |
Co-authored-by: shenald-dev <245350826+shenald-dev@users.noreply.github.com>
This run addresses a reliability gap by registering a
SIGTERMhandler on POSIX systems. Previously,echo-watchhandledKeyboardInterruptcorrectly for a clean shutdown but would exit instantly onSIGTERM(the standard exit signal sent by Docker and process managers). This behavior leaked running subprocesses in the background, consuming CPU/memory indefinitely.The script now intercepts
SIGTERMand routes it through the existing gracefulshutdown()logic, ensuringobserverstops cleanly and child processes are terminated successfully.Changes:
handle_sigtermto catchSIGTERMand triggerevent_handler.shutdown().if platform.system() != "Windows":to prevent cross-platform import/signal errors.Learningblock to.jules/bolt.mdreflecting on the importance ofSIGTERMhandlers in daemonized tools.PR created automatically by Jules for task 4164478307985291345 started by @shenald-dev