-
Notifications
You must be signed in to change notification settings - Fork 106
Reformat ActorSupervisionEvent #1881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
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
Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/) [ghstack-poisoned]
zdevito
added a commit
that referenced
this pull request
Nov 13, 2025
Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/) ghstack-source-id: 323132637 Pull Request resolved: #1881
Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/) [ghstack-poisoned]
zdevito
added a commit
that referenced
this pull request
Nov 14, 2025
Pull Request resolved: #1881 This changes the ActorSupervisionEvent structure so that we preserve enough information to give a good error message when an actor fails. The major changes are * removing jargon `processing error: superivision: `. * Adding user-understandable actor names. * identifying the actual actor that failed, and summarizing the default chain handling so that there are almost no wrappers around the error. Here are some examples of what it looks like now: When an actor directly errors: ``` I AM ABOUT TO ERROR!!!! Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Lambda actor> and all its descendants have failed. This occurred because the actor itself failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a nested actor errors: ``` python/tests/test_supervision_hierarchy.py::test_nested_mesh_kills_actor_actor_error Monarch internal logs are being written to /tmp/zdevito/monarch_log.log ERRORED THE ACTOR I AM ABOUT TO ERROR!!!! Nest still alive 0 Nest still alive 1 Nest still alive 2 Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor <root>.<tests.test_supervision_hierarchy.Nest actor>.<tests.test_supervision_hierarchy.Lambda nested> failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a proc errors: ``` Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor unix:@eRu5gzLrP1kdciNpAErvY1Q9,anon_0_16inPfUmdpwZ,agent[0] failed. The error was: The process unix:@eRu5gzLrP1kdciNpAErvY1Q9 owned by this actor became unresponsive and is assumed dead, check the log on the host for details ``` The proc error includes the changes added in D86984496 to make agent failures more clean. We should eventually further improve this by making sure we generate a supervision event specific to process failure as noticed by the host agent. That should include a friendly name for the process (the processes name given during spawn, and its owning actor). . ghstack-source-id: 323410911 Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/)
Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/) [ghstack-poisoned]
zdevito
added a commit
that referenced
this pull request
Nov 14, 2025
Pull Request resolved: #1881 This changes the ActorSupervisionEvent structure so that we preserve enough information to give a good error message when an actor fails. The major changes are * removing jargon `processing error: superivision: `. * Adding user-understandable actor names. * identifying the actual actor that failed, and summarizing the default chain handling so that there are almost no wrappers around the error. Here are some examples of what it looks like now: When an actor directly errors: ``` I AM ABOUT TO ERROR!!!! Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Lambda actor> and all its descendants have failed. This occurred because the actor itself failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a nested actor errors: ``` python/tests/test_supervision_hierarchy.py::test_nested_mesh_kills_actor_actor_error Monarch internal logs are being written to /tmp/zdevito/monarch_log.log ERRORED THE ACTOR I AM ABOUT TO ERROR!!!! Nest still alive 0 Nest still alive 1 Nest still alive 2 Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor <root>.<tests.test_supervision_hierarchy.Nest actor>.<tests.test_supervision_hierarchy.Lambda nested> failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a proc errors: ``` Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor unix:@eRu5gzLrP1kdciNpAErvY1Q9,anon_0_16inPfUmdpwZ,agent[0] failed. The error was: The process unix:@eRu5gzLrP1kdciNpAErvY1Q9 owned by this actor became unresponsive and is assumed dead, check the log on the host for details ``` The proc error includes the changes added in D86984496 to make agent failures more clean. We should eventually further improve this by making sure we generate a supervision event specific to process failure as noticed by the host agent. That should include a friendly name for the process (the processes name given during spawn, and its owning actor). . ghstack-source-id: 323426577 Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/)
Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/) [ghstack-poisoned]
zdevito
added a commit
that referenced
this pull request
Nov 14, 2025
Pull Request resolved: #1881 This changes the ActorSupervisionEvent structure so that we preserve enough information to give a good error message when an actor fails. The major changes are * removing jargon `processing error: superivision: `. * Adding user-understandable actor names. * identifying the actual actor that failed, and summarizing the default chain handling so that there are almost no wrappers around the error. Here are some examples of what it looks like now: When an actor directly errors: ``` I AM ABOUT TO ERROR!!!! Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Lambda actor> and all its descendants have failed. This occurred because the actor itself failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a nested actor errors: ``` python/tests/test_supervision_hierarchy.py::test_nested_mesh_kills_actor_actor_error Monarch internal logs are being written to /tmp/zdevito/monarch_log.log ERRORED THE ACTOR I AM ABOUT TO ERROR!!!! Nest still alive 0 Nest still alive 1 Nest still alive 2 Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor <root>.<tests.test_supervision_hierarchy.Nest actor>.<tests.test_supervision_hierarchy.Lambda nested> failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a proc errors: ``` Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor unix:@eRu5gzLrP1kdciNpAErvY1Q9,anon_0_16inPfUmdpwZ,agent[0] failed. The error was: The process unix:@eRu5gzLrP1kdciNpAErvY1Q9 owned by this actor became unresponsive and is assumed dead, check the log on the host for details ``` The proc error includes the changes added in D86984496 to make agent failures more clean. We should eventually further improve this by making sure we generate a supervision event specific to process failure as noticed by the host agent. That should include a friendly name for the process (the processes name given during spawn, and its owning actor). . ghstack-source-id: 323448669 Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/)
Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/) [ghstack-poisoned]
zdevito
added a commit
that referenced
this pull request
Nov 15, 2025
Pull Request resolved: #1881 This changes the ActorSupervisionEvent structure so that we preserve enough information to give a good error message when an actor fails. The major changes are * removing jargon `processing error: superivision: `. * Adding user-understandable actor names. * identifying the actual actor that failed, and summarizing the default chain handling so that there are almost no wrappers around the error. Here are some examples of what it looks like now: When an actor directly errors: ``` I AM ABOUT TO ERROR!!!! Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Lambda actor> and all its descendants have failed. This occurred because the actor itself failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a nested actor errors: ``` python/tests/test_supervision_hierarchy.py::test_nested_mesh_kills_actor_actor_error Monarch internal logs are being written to /tmp/zdevito/monarch_log.log ERRORED THE ACTOR I AM ABOUT TO ERROR!!!! Nest still alive 0 Nest still alive 1 Nest still alive 2 Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor <root>.<tests.test_supervision_hierarchy.Nest actor>.<tests.test_supervision_hierarchy.Lambda nested> failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a proc errors: ``` Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor unix:@eRu5gzLrP1kdciNpAErvY1Q9,anon_0_16inPfUmdpwZ,agent[0] failed. The error was: The process unix:@eRu5gzLrP1kdciNpAErvY1Q9 owned by this actor became unresponsive and is assumed dead, check the log on the host for details ``` The proc error includes the changes added in D86984496 to make agent failures more clean. We should eventually further improve this by making sure we generate a supervision event specific to process failure as noticed by the host agent. That should include a friendly name for the process (the processes name given during spawn, and its owning actor). . ghstack-source-id: 323464467 Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/)
Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/) [ghstack-poisoned]
zdevito
added a commit
that referenced
this pull request
Nov 15, 2025
Pull Request resolved: #1881 This changes the ActorSupervisionEvent structure so that we preserve enough information to give a good error message when an actor fails. The major changes are * removing jargon `processing error: superivision: `. * Adding user-understandable actor names. * identifying the actual actor that failed, and summarizing the default chain handling so that there are almost no wrappers around the error. Here are some examples of what it looks like now: When an actor directly errors: ``` I AM ABOUT TO ERROR!!!! Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Lambda actor> and all its descendants have failed. This occurred because the actor itself failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a nested actor errors: ``` python/tests/test_supervision_hierarchy.py::test_nested_mesh_kills_actor_actor_error Monarch internal logs are being written to /tmp/zdevito/monarch_log.log ERRORED THE ACTOR I AM ABOUT TO ERROR!!!! Nest still alive 0 Nest still alive 1 Nest still alive 2 Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor <root>.<tests.test_supervision_hierarchy.Nest actor>.<tests.test_supervision_hierarchy.Lambda nested> failed. The error was: Traceback (most recent call last): File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1068, in handle response_port.exception(ActorError(e)) File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 828, in exception raise obj from None File "/data/users/zdevito/fbsource/fbcode/monarch/python/monarch/_src/actor/actor_mesh.py", line 1062, in handle result = the_method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 19, in run return l() ^^^ File "/data/users/zdevito/fbsource/fbcode/monarch/python/tests/test_supervision_hierarchy.py", line 46, in error raise ValueError("Error.") ValueError: Error. ``` When a proc errors: ``` Unhandled monarch error on the top-level client: The actor <root>.<tests.test_supervision_hierarchy.Nest actor> and all its descendants have failed. This occurred because the actor unix:@eRu5gzLrP1kdciNpAErvY1Q9,anon_0_16inPfUmdpwZ,agent[0] failed. The error was: The process unix:@eRu5gzLrP1kdciNpAErvY1Q9 owned by this actor became unresponsive and is assumed dead, check the log on the host for details ``` The proc error includes the changes added in D86984496 to make agent failures more clean. We should eventually further improve this by making sure we generate a supervision event specific to process failure as noticed by the host agent. That should include a friendly name for the process (the processes name given during spawn, and its owning actor). . ghstack-source-id: 323494574 Differential Revision: [D86925582](https://our.internmc.facebook.com/intern/diff/D86925582/)
|
This pull request has been merged in a1e5e4c. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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):
Differential Revision: D86925582