-
Notifications
You must be signed in to change notification settings - Fork 99
[monarch] Add configurable stacktrace on unawaited pytokio PythonTask, and make an unawaited error crash the process #1679
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
+139
−33
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
…, and make an unawaited error crash the process This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash". Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)! [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 27, 2025
…, and make an unawaited error crash the process This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash". Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)! ghstack-source-id: 319066349 Pull Request resolved: #1679
… PythonTask, and make an unawaited error crash the process" This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash". Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)! [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 27, 2025
…, and make an unawaited error crash the process Pull Request resolved: #1679 This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash". ghstack-source-id: 319067613 @exported-using-ghexport Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)!
… PythonTask, and make an unawaited error crash the process" This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash". Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)! [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 28, 2025
Pull Request resolved: #1679 This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that the panic trace isn't printed anymore, and the new warning makes it clear that the unawaited task is *not* the cause of a crash. This should ideally make it less scary and less likely to cause people to go down a fruitless rabbit hole. ghstack-source-id: 319305090 @exported-using-ghexport Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)!
… PythonTask, and make an unawaited error crash the process" This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash". Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)! [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 28, 2025
Pull Request resolved: #1679 This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that the panic trace isn't printed anymore, and the new warning makes it clear that the unawaited task is *not* the cause of a crash. This should ideally make it less scary and less likely to cause people to go down a fruitless rabbit hole. ghstack-source-id: 319337699 @exported-using-ghexport Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)!
… PythonTask, and make an unawaited error crash the process" This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash". Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)! [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 29, 2025
Pull Request resolved: #1679 This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that the panic trace isn't printed anymore, and the new warning makes it clear that the unawaited task is *not* the cause of a crash. This should ideally make it less scary and less likely to cause people to go down a fruitless rabbit hole. ghstack-source-id: 319407613 @exported-using-ghexport Differential Revision: [D85614449](https://our.internmc.facebook.com/intern/diff/D85614449/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85614449/)!
|
This pull request has been merged in 17de318. |
AlirezaShamsoshoara
pushed a commit
to AlirezaShamsoshoara/monarch
that referenced
this pull request
Oct 30, 2025
…orch#1679) Summary: Pull Request resolved: meta-pytorch#1679 This diff adds the environment variable `MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK`, which is 0 by default. When it is set to 1, errors in unawaited pytokio `PythonTask` instances will print a traceback indicating where the `PythonTask` was created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each new `PythonTask`. This diff also makes it so that the panic trace isn't printed anymore, and the new warning makes it clear that the unawaited task is *not* the cause of a crash. This should ideally make it less scary and less likely to cause people to go down a fruitless rabbit hole. ghstack-source-id: 319407613 exported-using-ghexport Reviewed By: shayne-fletcher Differential Revision: D85614449 fbshipit-source-id: 10b85568becf2470be735790051501ecf7ab0bea
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):
This diff adds the environment variable
MONARCH_HYPERACTOR_UNAWAITED_PYTOKIO_TRACEBACK, which is 0 by default. When it is set to 1, errors in unawaited pytokioPythonTaskinstances will print a traceback indicating where thePythonTaskwas created in addition to the error itself. This should only be used for development/debugging, because it adds overhead to compute the traceback for each newPythonTask.This diff also makes it so that errors in unawaited pytokio tasks crash the process instead of just printing the panic trace. This makes it more consistent with the monarch philosophy of "any unhandled failure should crash".
Differential Revision: D85614449
NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!