-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Avoid throwing exception in ClosingTHPObjectPtr #109758
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
Conversation
Previously, if ClosingTHPObjectPtr was destructed because we were unwinding the stack from an exception, we would attempt to call close() which just isn't going to work. Two fixes: 1. Detect if we're unwinding due to a Python error, and don't try to do more Python stuff if so. 2. If close() fails somehow, write an unraisable exception, don't try to throw because that will terminate if you're in an exception. Signed-off-by: Edward Z. Yang <ezyang@meta.com> [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/109758
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 93e5f54 with merge base 9c2715b ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Previously, if ClosingTHPObjectPtr was destructed because we were unwinding the stack from an exception, we would attempt to call close() which just isn't going to work. Two fixes: 1. Detect if we're unwinding due to a Python error, and don't try to do more Python stuff if so. 2. If close() fails somehow, write an unraisable exception, don't try to throw because that will terminate if you're in an exception. Signed-off-by: Edward Z. Yang <ezyangmeta.com> ghstack-source-id: b445aab Pull Request resolved: #109758
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
Previously, if ClosingTHPObjectPtr was destructed because we
were unwinding the stack from an exception, we would attempt to call
close() which just isn't going to work. Two fixes:
Detect if we're unwinding due to a Python error, and don't try
to do more Python stuff if so.
If close() fails somehow, write an unraisable exception, don't
try to throw because that will terminate if you're in an
exception.
Signed-off-by: Edward Z. Yang ezyang@meta.com
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng