-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-90467: StreamReaderProtocol - add strong reference to created task #96323
gh-90467: StreamReaderProtocol - add strong reference to created task #96323
Conversation
Oh now I have to research whether it’s possible to have more than one task (like the other PR #30505 assumed) and if so whether it’s necessary to keep all of them alive, or just the most recent one. |
hmm, cpython/Lib/asyncio/streams.py Lines 77 to 83 in ccf94a6
and
cpython/Lib/asyncio/protocols.py Lines 66 to 90 in ccf94a6
|
Yeah, that sounds about right. I'll give the author and reviewers of the other PR some time to find a flaw in this argument. In the meantime I'm going to press the Update branch button. |
Also you still need to add a blurb -- see the failing test for instructions. |
Don't see a flaw. I'm not entirely sure why I thought it might be called multiple times for concurrent connections. A protocol should be used for only one connection and the state machine is not per connection but per protocol. As long as the end user plays according to the book it seems like I made a mistake. The test simply leaks until the cleanup function removes the loop and the GC activates. You can choose whether to include it or not. Please add Simon to the acks :-) His original PR was the same until I modified it. |
dc7c144
to
83a816d
Compare
Thanks @python273 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
GH-96344 is a backport of this pull request to the 3.11 branch. |
…d task (pythonGH-96323) (cherry picked from commit e860e52) Co-authored-by: Kirill <[email protected]>
…d task (pythonGH-96323) (cherry picked from commit e860e52) Co-authored-by: Kirill <[email protected]>
GH-96345 is a backport of this pull request to the 3.10 branch. |
…GH-96323) (#96344) (cherry picked from commit e860e52) Co-authored-by: Kirill <[email protected]> Co-authored-by: Kirill <[email protected]>
…GH-96323) (cherry picked from commit e860e52) Co-authored-by: Kirill <[email protected]>
gh-90467: StreamReaderProtocol - add strong reference to created task