Skip to content

Conversation

@pzhan9
Copy link
Contributor

@pzhan9 pzhan9 commented Nov 17, 2025

Summary: It is useful to know which pid this proc is running on. In the long run, we probably should use hyper cli to get this info, but a log should be also good as a quick workaround.

Reviewed By: mariusae

Differential Revision: D87112445

Summary:

There is a bug in `Instance`'s current Drop impl:

https://www.internalfb.com/code/fbsource/[5b70b5b30638d5db5dfef1cbf929dea6df7d3f56]/fbcode/monarch/hyperactor/src/proc.rs?lines=1594-1596

since we clone a `Instance` object on the python side:

https://www.internalfb.com/code/fbsource/[5b70b5b30638d5db5dfef1cbf929dea6df7d3f56]/fbcode/monarch/hyperactor/src/proc.rs?lines=1566

It means the Instance's actor status will be changed to `Stopped` when a clone is dropped, although the actor is still alive.

This diff adds a `InstanceState` struct, so the instance's lifetime can tracked by `Arc`'s ref counter. Then we move the `Drop` impl to this  `InstanceState`, so it will only be called when the ref count goes to 0.

Reviewed By: dulinriley

Differential Revision: D87075455
Summary:

1. Use `name = "SupervisionEvent"` so the supervision logs can be searched with this value;
2. Change log levels: `warn` for error and `debug` for others.

Reviewed By: mariusae

Differential Revision: D87094538
Summary: As title

Reviewed By: mariusae

Differential Revision: D87111325
Summary: It is useful to know which pid this proc is running on. In the long run, we probably should use hyper cli to get this info, but a log should be also good as a quick workaround.

Reviewed By: mariusae

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

meta-codesync bot commented Nov 17, 2025

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

@meta-codesync
Copy link

meta-codesync bot commented Nov 17, 2025

This pull request has been merged in f67f81c.

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