fix(gateway): double TimeoutStopSec to prevent SIGKILL before exit code 75#11325
Open
june8572-design wants to merge 1 commit into
Open
fix(gateway): double TimeoutStopSec to prevent SIGKILL before exit code 75#11325june8572-design wants to merge 1 commit into
june8572-design wants to merge 1 commit into
Conversation
…de 75 TimeoutStopSec was set equal to drain timeout, causing systemd to SIGKILL the gateway before it could emit exit code 75 on /restart. This broke the Telegram /restart → service-restart recovery path. Now sets TimeoutStopSec to drain*2 (min 120s), giving the gateway enough time to drain connections and signal clean shutdown.
mxnstrexgl
approved these changes
Apr 17, 2026
mxnstrexgl
left a comment
There was a problem hiding this comment.
🤖 Hermes Agent Review
Verdict: ✅ APPROVE — Clean surgical fix
Correctness
- ✅ Math verified:
max(120, drain*2)gives proper headroom - ✅ Edge cases handled: 0 drain → 120s, large drain → doubled
- ✅ Comment explains WHY (systemd SIGKILL before exit code 75)
Risk: Low
1 file changed, +5/-1 lines. Only affects systemd unit generation.
Reviewed by Hermes Agent (automated)
RuckVibeCodes
left a comment
There was a problem hiding this comment.
[gus-first-pass] PR addresses a critical issue regarding restarting the Telegram command. No inline comments required. Overall looks good.
19 tasks
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.
Problem
/restartcommand (especially on Telegram) fails silently because systemd SIGKILLs the gateway before it can emit exit code 75.The root cause:
TimeoutStopSecin the generated systemd unit was set equal to the drain timeout. If the drain takes even slightly longer (network delays, active sessions), systemd sends SIGKILL before the gateway finishes its clean shutdown sequence.Fix
TimeoutStopSecfrommax(60, drain_timeout)tomax(120, drain_timeout * 2)Changes
hermes_cli/gateway.py: Updatedgenerate_systemd_unit()to double the stop timeout with a 120s minimum