Skip to content

fix(gateway): systemd KillMode=mixed + restart drain timeout + cron stop guard (#37454 #37453 #37858)#39577

Open
ashishpatel26 wants to merge 1 commit into
NousResearch:mainfrom
ashishpatel26:fix/systemd-rebase-37454-37453-37858
Open

fix(gateway): systemd KillMode=mixed + restart drain timeout + cron stop guard (#37454 #37453 #37858)#39577
ashishpatel26 wants to merge 1 commit into
NousResearch:mainfrom
ashishpatel26:fix/systemd-rebase-37454-37453-37858

Conversation

@ashishpatel26

Copy link
Copy Markdown
Contributor

Summary

  • gateway/run.py: added
    unner=None param to _start_cron_ticker(); each tick checks getattr(runner, "_draining", False) before calling cron_tick(), preventing outbound LLM calls after hermes gateway stop
  • hermes_cli/gateway.py: manual restart path now derives timeout from _get_restart_drain_timeout() instead of hardcoded 10s, preventing race-to-port when drain takes longer
  • Tests: TestSystemdKillMode, TestManualRestartDrainWait, est_cron_drain_guard.py (4 tests)

Fixes #37454 #37453 #37858

🤖 Generated with Claude Code

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cron Cron scheduler and job management area/config Config system, migrations, profiles labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gateway: orphan processes in cgroup block systemd restart for 6+ minutes

2 participants