Skip to content

Conversation

@dulinriley
Copy link
Contributor

Summary:
Instead of relying on sending SIGTERM, give the process a chance to clean itself up
gracefully.
Have the StopAll message on ProcMeshAgent call exit(0) if it is able to clean up all
actors successfully, or exit(1) if there's an issue.

Then, instead of awaiting a reply from the actor, use the wait() functionality of
ProcHandle to wait for it to exit. This way we don't get the SIGTERM stack dump,
and gives the user process a chance to run atexit handlers such as static C++
object destructors (SIGTERM bypasses atexit handlers).

This also means nothing uses GetAllRankStatus anymore, and we can delete it!
We may also want to rename StopAll to StopSelf or something that implies it'll
stop itself as well.

Reviewed By: shayne-fletcher

Differential Revision: D87108568

Summary:
Instead of relying on sending SIGTERM, give the process a chance to clean itself up
gracefully.
Have the StopAll message on ProcMeshAgent call exit(0) if it is able to clean up all
actors successfully, or exit(1) if there's an issue.

Then, instead of awaiting a reply from the actor, use the `wait()` functionality of
ProcHandle to wait for it to exit. This way we don't get the SIGTERM stack dump,
and gives the user process a chance to run atexit handlers such as static C++
object destructors (SIGTERM bypasses atexit handlers).

This also means nothing uses GetAllRankStatus anymore, and we can delete it!
We may also want to rename StopAll to StopSelf or something that implies it'll
stop itself as well.

Reviewed By: shayne-fletcher

Differential Revision: D87108568
@meta-codesync
Copy link

meta-codesync bot commented Nov 14, 2025

@dulinriley has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87108568.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2025
@meta-codesync meta-codesync bot closed this in a1ae076 Nov 15, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 15, 2025

This pull request has been merged in a1ae076.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants