[hyperactor_mesh] two-phase shutdown for HostMesh#3210
Open
mariusae wants to merge 2 commits intogh/mariusae/323/basefrom
Open
[hyperactor_mesh] two-phase shutdown for HostMesh#3210mariusae wants to merge 2 commits intogh/mariusae/323/basefrom
mariusae wants to merge 2 commits intogh/mariusae/323/basefrom
Conversation
HostMesh::shutdown and HostMesh::stop now use a two-phase approach: 1. Terminate all user procs concurrently across hosts via a new TerminateChildren message. Service infrastructure (host agent, comm proc, networking) stays alive so forwarder flushes can still reach remote hosts. 2. Shut down/stop hosts concurrently. No user procs remain, so this is fast and cannot deadlock on cross-host flush timeouts. Previously, each host's ShutdownHost handler terminated children and then tore down networking atomically. Under concurrent shutdown, one host could destroy its networking while another host's dying procs were still flushing forwarders to it, causing hangs until MESSAGE_DELIVERY_TIMEOUT expired. Also bumps comm test timeouts from 60s to 120s to accommodate stress-run CPU contention. Differential Revision: [D98180932](https://our.internmc.facebook.com/intern/diff/D98180932/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D98180932/)! [ghstack-poisoned]
mariusae
added a commit
that referenced
this pull request
Mar 25, 2026
HostMesh::shutdown and HostMesh::stop now use a two-phase approach: 1. Terminate all user procs concurrently across hosts via a new TerminateChildren message. Service infrastructure (host agent, comm proc, networking) stays alive so forwarder flushes can still reach remote hosts. 2. Shut down/stop hosts concurrently. No user procs remain, so this is fast and cannot deadlock on cross-host flush timeouts. Previously, each host's ShutdownHost handler terminated children and then tore down networking atomically. Under concurrent shutdown, one host could destroy its networking while another host's dying procs were still flushing forwarders to it, causing hangs until MESSAGE_DELIVERY_TIMEOUT expired. Also bumps comm test timeouts from 60s to 120s to accommodate stress-run CPU contention. Differential Revision: [D98180932](https://our.internmc.facebook.com/intern/diff/D98180932/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D98180932/)! ghstack-source-id: 357664288 Pull Request resolved: #3210
HostMesh::shutdown and HostMesh::stop now use a two-phase approach: 1. Terminate all user procs concurrently across hosts via a new TerminateChildren message. Service infrastructure (host agent, comm proc, networking) stays alive so forwarder flushes can still reach remote hosts. 2. Shut down/stop hosts concurrently. No user procs remain, so this is fast and cannot deadlock on cross-host flush timeouts. Previously, each host's ShutdownHost handler terminated children and then tore down networking atomically. Under concurrent shutdown, one host could destroy its networking while another host's dying procs were still flushing forwarders to it, causing hangs until MESSAGE_DELIVERY_TIMEOUT expired. Also bumps comm test timeouts from 60s to 120s to accommodate stress-run CPU contention. Differential Revision: [D98180932](https://our.internmc.facebook.com/intern/diff/D98180932/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D98180932/)! [ghstack-poisoned]
This was referenced Mar 25, 2026
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.
Stack from ghstack (oldest at bottom):
HostMesh::shutdown and HostMesh::stop now use a two-phase approach:
TerminateChildren message. Service infrastructure (host agent,
comm proc, networking) stays alive so forwarder flushes can
still reach remote hosts.
this is fast and cannot deadlock on cross-host flush timeouts.
Previously, each host's ShutdownHost handler terminated children
and then tore down networking atomically. Under concurrent shutdown,
one host could destroy its networking while another host's dying
procs were still flushing forwarders to it, causing hangs until
MESSAGE_DELIVERY_TIMEOUT expired.
Also bumps comm test timeouts from 60s to 120s to accommodate
stress-run CPU contention.
Differential Revision: D98180932
NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!