fix(gateway): classify planned service restarts - #57419
Open
dorukardahan wants to merge 3 commits into
Open
dorukardahan wants to merge 3 commits into
dorukardahan wants to merge 3 commits into
Conversation
teknium1
reviewed
Jul 15, 2026
teknium1
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the careful PID/start-time and stale-marker handling. The current patch is incomplete, however.
Problems
- The new marker is never written by production code.
gateway/status.pyaddswrite_planned_service_restart_marker(), andgateway/run.pyconsumes it, butgh pr diff 57419contains no call to the writer. The planned-service-restart branch therefore cannot run. - The added tests cover helper serialization/consumption only; they do not exercise a restart initiator and the signal-handler classification together.
- Current main has changed restart mechanics:
hermes_cli/gateway.py:3299-3356first attempts SIGUSR1/exit-75 restart handling and falls back tosystemctl restart. The salvage needs to integrate with that live flow rather than only adding a signal-handler marker consumer.
Suggested changes
- Write the marker immediately before the applicable current SIGTERM/service-restart operation, using its target PID.
- Add an end-to-end unit-level test for writer → signal handler classification, including the current fallback path.
Automated hermes-sweeper review.
# Conflicts: # gateway/status.py # tests/gateway/test_status.py
Contributor
Author
|
Refreshed onto current The planned-service-restart marker is now written immediately before the existing forced service-restart operations:
The focused integration test exercises the real systemd initiator order and verifies that the marker consumer classifies the target as planned before Validation on candidate
|
# Conflicts: # tests/hermes_cli/test_gateway_service.py
This branch has not been deployed
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.
Summary
Classifies service-managed gateway restarts as planned service restarts instead of unexpected external kills or
--replacetakeovers:.gateway-planned-service-restart.jsonmarker--replaceflowsRoot cause
v0.18.0 has restart/takeover markers, but a normal service-manager restart sends the same SIGTERM shape as an unexpected external kill. Reusing the takeover marker makes operator logs misleading; having no marker misclassifies planned service restarts.
Related open issues
Related merged precedent
Scope / risk
Verification
python -m pytest tests/gateway/test_status.pypython -m py_compile gateway/status.py gateway/run.py gateway/shutdown_forensics.py tests/gateway/test_status.pygit diff --check878298a27f59