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
Fix nursery crashing during a guest run when the host loop calls start_soon(needs_sniffio)
#2462
Fix nursery crashing during a guest run when the host loop calls start_soon(needs_sniffio)
#2462
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2462 +/- ##
=======================================
Coverage 92.45% 92.45%
=======================================
Files 118 118
Lines 16342 16351 +9
Branches 3155 3156 +1
=======================================
+ Hits 15109 15118 +9
Misses 1104 1104
Partials 129 129
|
32f8c0c
to
e45cec2
Compare
start_soon(needs_sniffio)
failing when called by the host loop during a guest runstart_soon(needs_sniffio)
during a guest run
start_soon(needs_sniffio)
during a guest runstart_soon(needs_sniffio)
e45cec2
to
d826355
Compare
441514d
to
44fe095
Compare
I just force-pushed what should be a fix for the bug in the test. |
44fe095
to
7ecfbd2
Compare
I've just fixed the (Curiously, the test only hung forever when using a >= 3.8 |
0802b9b
to
977a71c
Compare
rebased onto master and updated the newsfragment issue number. |
the CI failure on pypy3.8 nightly on Ubuntu appears to be unrelated to this PR and may just be a flaky failure. the new test that this PR adds did pass on the pypy3.8 nightly on Ubuntu CI. the failure appears to be due to a segfault that occurred while pytest was handling the failure of the new test on Windows+Komodia LSP, however, was occurring before the rebase and is still something that is pretty beyond me—I would be much appreciative if someone familiar with Komodia LSP could help look into it. |
2e05760
to
9e9582e
Compare
The new commit I pushed merges #2574 into this PR, in essentially the state that #2574 would be by applying your review comments to it. Using this roundabout method has the advantage of acknowledging your contribution and inviting you to join the python-trio org! If you acknowledge that you are ok with this, I'll bring it all up to date with master and merge. |
this looks great to me, thanks @richardsheridan! also, for what it's worth, i am already a member of the Trio github org, but i still appreciate that this PR acknowledges both my and oremanj's contributions here :) (i'm also on the trio gitter—not sure what caused trouble when you tried searching for me there!) |
newsfragments/2574.bugfix.rst
Outdated
@@ -0,0 +1 @@ | |||
Fix :func:`sniffio.current_async_library` when Trio tasks are spawned from a non-Trio context (such as when using trio-asyncio). Previously, a regular Trio task would inherit the non-Trio library name, and spawning a system task would cause the non-Trio caller to start thinking it was Trio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might make sense to overwrite 2183.bugfix.rst
with this new message instead of keeping both. my message in 2183.bugfix.rst
just describes a specific case of oremanj's message here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardsheridan it looks like you did git mv newsfragments/{2574,2462}.bugfix.rst
, meaning there are still two redundant changelog entries—was that your intention? to clarify, i meant to suggest git mv -f newsfragments/{2574,2183}.bugfix.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! I think the commit message phrasing fits better if the link points here to the fix. I'll push a clean renumber commit when CI is working again.
I also added a test for your edge case of a function returning a coroutine! |
6152019
to
ee0bf40
Compare
Closes #2183.