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
Cannot pause asyncio transport immediately #103607
Labels
Comments
@LasseBlaauwbroek This makes sense, could you make a PR (with tests, please)? |
This was referenced Apr 20, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Apr 27, 2023
…tion_made` in `asyncio`. (pythonGH-17425) (cherry picked from commit 78942ec) Co-authored-by: Itayazolay <itayazolay@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
kumaraditya303
added a commit
that referenced
this issue
Apr 27, 2023
…ade` in `asyncio`. (#17425) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
kumaraditya303
added a commit
that referenced
this issue
Apr 27, 2023
…ction_made` in `asyncio`. (GH-17425) (#103918) gh-103607: Fix `pause_reading` to work when called from `connection_made` in `asyncio`. (GH-17425) (cherry picked from commit 78942ec) Co-authored-by: Itayazolay <itayazolay@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug report
When creating a asyncio transport/protocol pair, one might want to call
transport.pause_reading()
immediately whenprotocol.connection_made()
is called. This is currently not possible. The call topause_reading()
is ignored, and reading commences nonetheless.This is problematic, because there is no other place where the transport can be immediately paused, especially when the protocol is created through
loop.create_server
.As a remedy, I would suggest guarding
cpython/Lib/asyncio/selector_events.py
Lines 931 to 932 in ece20db
with
if not self._paused:
. There might be other places where this is needed, for other event loops.Linked PRs
pause_reading
to work when called fromconnection_made
inasyncio
. (GH-17425) #103918The text was updated successfully, but these errors were encountered: