Skip to content

Conversation

@samlurye
Copy link
Contributor

@samlurye samlurye commented Oct 27, 2025

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 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

NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!

…, 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
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 2025
… 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/)!
@meta-codesync meta-codesync bot closed this in 17de318 Oct 29, 2025
@meta-codesync
Copy link

meta-codesync bot commented Oct 29, 2025

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

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.

3 participants