fix(gateway): use --no-block for systemctl restart to avoid D-Bus hang#30297
Open
konsisumer wants to merge 1 commit into
Open
fix(gateway): use --no-block for systemctl restart to avoid D-Bus hang#30297konsisumer wants to merge 1 commit into
konsisumer wants to merge 1 commit into
Conversation
This was referenced May 23, 2026
Contributor
Author
|
Rebased onto current The remaining red |
4873eaf to
f201148
Compare
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.
What changed and why
Calling
systemctl (--user) restartmakes a synchronous D-Bus call that blocks indefinitely when the D-Bus session bus loses its connection during the restart handoff. This reproduces reliably on Ubuntu 24.04 ARM64 with a Linuxbrew-installed Hermes user unit (issue #29421).Per the reporter's diagnostics on 2026-05-21: both
hermes gateway restartand the rawsystemctl --user restart hermes-gatewayhang, whilesystemctl --user --no-block restart hermes-gatewayreturns immediately (exit 0), pointing squarely at the D-Bus job-wait.Added
--no-blockto everysystemctl restartinvocation insidesystemd_restart()(three call sites: post-graceful-drain, forced-restart fallback, and cold-start). The existing_wait_for_systemd_service_restart()poll loop already handles waiting for the new PID and printing progress messages, so operator-visible behaviour is unchanged.How to test
hermes gateway restart— it should complete and print✓ User service restarted (PID N)instead of hanging.strace -e trace=sendmsg,recvmsg hermes gateway restart— confirm that thesystemctlchild exits quickly rather than blocking on D-Bus receives.What platforms tested on
Fixes #29421