-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
When creating a asyncio transport/protocol pair, one might want to call transport.pause_reading() immediately when protocol.connection_made() is called. This is currently not possible. The call to pause_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
| self._loop.call_soon(self._add_reader, | |
| self._sock_fd, self._read_ready) |
with
if not self._paused:. There might be other places where this is needed, for other event loops.
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done