fix(gateway): refresh systemd units before update restart - #34464
fix(gateway): refresh systemd units before update restart#34464leprincep35700 wants to merge 1 commit into
Conversation
689e235 to
09dfa14
Compare
|
Post-current-main reassessment: I rechecked this after the recent gateway/service restart work landed, especially #36188, #35679, #34805, and related gateway fixes. Conclusion: this PR still has a useful remaining scope, but the framing should be updated. What upstream now covers:
What is still not covered on current
Recommendation:
|
a54f456 to
3899412
Compare
|
Rebased onto current
|
bf1503a to
22b04ec
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for preserving a real update/restart failure mode: current main still enumerates active hermes-gateway* systemd services and restarts them without a pre-restart unit refresh (hermes_cli/main.py:10560-10604). That matters because a stale WorkingDirectory can fail at systemd's CHDIR step before gateway boot-time refresh code runs (hermes_cli/gateway.py:2667-2671).
Problems
- The proposed helper refreshes only the active profile's two scope paths (
hermes_cli/main.py:7831-7834in PR head).refresh_systemd_unit_if_needed()derives a single service path from the current HERMES_HOME (hermes_cli/gateway.py:1778-1795on main), while the update path restarts every discoveredhermes-gateway*unit. Additional profile services can therefore still restart through stale units.
Suggested changes
- Refresh each discovered service/profile before its update-triggered signal/restart, rather than refreshing only the caller's active profile.
- Add a multi-profile regression test proving each selected unit refreshes before restart.
Automated hermes-sweeper review.
22b04ec to
ff7b1f2
Compare
|
Rebased onto current Validation:
Updated head: |
Summary
hermes updaterestarts Gateway services, refresh every discoveredhermes-gateway*.serviceunit rather than only the active profile.HERMES_HOME, regenerate that unit in its own profile scope, and restore the caller environment afterwards.Why
An update can pull the fix for a stale unit but still restart through that stale unit. With multiple profiles, refreshing only the caller’s unit leaves
hermes-gateway-coder,hermes-gateway-assistant, and other discovered services stale before they are signaled. This change refreshes each exact unit before restarting it.Fixes #31048.
Review resolution
The multi-profile review is addressed in
ff7b1f2fd501: the regression test installs default andcoderunits with different pinned homes, refreshes both by service name, and asserts that each generated unit retains its own home. A separate test covers traversal-style explicit service names. The review thread has been replied to and resolved.Validation
Rebased head:
ff7b1f2fd501;mainbase:c44de9985.