You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cancelling asyncio native sendfile during setup leaves the transport paused #157025
Cancelling loop.sendfile() while its native implementation is waiting for the transport's write buffer to become empty leaves the transport in a partially modified state. The transport remains paused and retains its internal empty-buffer waiter. The selector implementation additionally leaves the transport absent from the event loop's transport registry.
The cancellation window exists in both BaseSelectorEventLoop._sendfile_native() and BaseProactorEventLoop._sendfile_native().
The controlled transport is paused but never resumed, and its waiter is not reset:
True False True
On the selector implementation, the same cancellation point also leaves transport._sock_fd absent from loop._transports.
Expected Behavior
Cancellation should propagate without leaving the transport in a partially modified state. Reading should be restored when it was active before sendfile(), the empty-buffer waiter should be reset, and the selector implementation should restore the transport registry entry.
Activity
gh-157025: Fix transport cleanup when cancelling asyncio native sendf…
pythongh-157025: Fix transport cleanup when cancelling asyncio native…