diff options
| author | Jens Axboe <axboe@kernel.dk> | 2026-10-29 13:38:18 -0600 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-11-03 09:20:20 -0700 |
| commit | 74c1f1048e4401d6a953ab2299b14ace1ad6a899 (patch) | |
| tree | 853bcf01745b43c7b9c67dafab90c3fb171fd7cb /tools/lib/python | |
| parent | 9eff9c07e927dcd9c57150cd6fb3d4ec76f00480 (diff) | |
io_uring/poll: don't poll a writer for a read side hangup
io_init_poll_iocb() adds EPOLLRDHUP to every poll, including the async
poll of a send that waits for buffer space. Once the peer has shut down
its sending side, the socket keeps reporting EPOLLRDHUP, so each re-arm
in __io_arm_poll_handler() finds a ready mask and the request is issued
again. The send still can't make progress, the request burns through
APOLL_MAX_RETRY in a few milliseconds and ends up in io-wq.
A send in io-wq blocks until the peer reads, but sendmsg and writev go
through ____sys_sendmsg() and sock_write_iter(), which turn O_NONBLOCK
into MSG_DONTWAIT, and the application gets -EAGAIN for a request that
never asked for a non-blocking send.
Only add EPOLLRDHUP for polls that want to read. A peer that stopped
sending is no event for a writer, and a poll that asks for it explicitly
still gets it.
Fixes: 464dca612bc6 ("io_uring: mask in error/nval/hangup consistently for poll")
Reported-by: Lukáš Lalinský <lukas@lalinsky.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
