Skip to content

Conversation

@dulinriley
Copy link
Contributor

Summary:
Non-local processes that are being stopped with v1 proc_mesh.stop() go right
to SIGTERM, and don't give actors a chance to stop themselves. LocalHandle processes use
"destroy_and_wait" already.
That didn't matter a lot before, but we'd like for Actors to have a chance to run cleanups
in Drop, and in the future the Actor::cleanup trait function.

This change asks the ProcMeshAgent to stop the actors on the proc before sending a
SIGTERM, which gives a chance for more cooperative cleanup. Note that the process still
gets SIGTERM, as "destroy_and_wait" (and by extension, the StopAll message) does not exit
the process. We make sure to await the StopAll message response, so that we don't
try to SIGTERM actors that are already stopping.

Reviewed By: shayne-fletcher

Differential Revision: D85795859

Summary:
Non-local processes that are being stopped with v1 `proc_mesh.stop()` go right
to SIGTERM, and don't give actors a chance to stop themselves. LocalHandle processes use
"destroy_and_wait" already.
That didn't matter a lot before, but we'd like for Actors to have a chance to run cleanups
in Drop, and in the future the `Actor::cleanup` trait function.

This change asks the ProcMeshAgent to stop the actors on the proc before sending a
SIGTERM, which gives a chance for more cooperative cleanup. Note that the process still
gets SIGTERM, as "destroy_and_wait" (and by extension, the StopAll message) does not exit
the process. We make sure to `await` the StopAll message response, so that we don't
try to SIGTERM actors that are already stopping.

Reviewed By: shayne-fletcher

Differential Revision: D85795859
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 30, 2025
@meta-codesync
Copy link

meta-codesync bot commented Oct 30, 2025

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

@meta-codesync
Copy link

meta-codesync bot commented Oct 30, 2025

This pull request has been merged in b02b329.

@dulinriley dulinriley deleted the export-D85795859 branch November 26, 2025 19:03
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