Skip to content
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

allow_threads: switch from catch_unwind to guard pattern #1990

Merged
merged 1 commit into from Nov 15, 2021

Conversation

davidhewitt
Copy link
Member

See pantsbuild/pants#13526 (comment)

I think that use of catch_unwind in allow_threads may currently catch non-Rust exceptions too (it's not particularly clear), leading to nasty crashes.

Switching to a guard pattern might avoid this.

cc @Eric-Arellano can you try your pants PR against this branch and see if it fixes?

@Eric-Arellano
Copy link
Contributor

Yay this fixes the two problems I was seeing! 1) The crash on Linux, and 2) the async thread was not actually finishing on macOS. Thank you so much 🙌 Everything now works without needing to make any more changes to Pants, woot!

Thanks to Cargo's git support, once this merges, I think Pants is fully unblocked now from hitting merge on pantsbuild/pants#13526 🚀

@davidhewitt
Copy link
Member Author

Great! I was thinking of putting out 0.15.1 within a week anyway to include a few non-breaking additions before starting breaking stuff for 0.16, so I'll make sure to include this in that release.

@davidhewitt davidhewitt merged commit 45059cb into PyO3:main Nov 15, 2021
@davidhewitt davidhewitt deleted the allow-threads-unwind branch November 15, 2021 13:03
jsirois added a commit to jsirois/pants that referenced this pull request Nov 28, 2021
This includes a fix we were waiting on in pantsbuild#13526:
  PyO3/pyo3#1990

Changelog here: https://pyo3.rs/v0.15.1/changelog.html

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
jsirois added a commit to pantsbuild/pants that referenced this pull request Nov 28, 2021
This includes a fix we were waiting on in #13526:
  PyO3/pyo3#1990

Changelog here: https://pyo3.rs/v0.15.1/changelog.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants