client: resend only the unsent tail after a short io_uring send #122

Open
lei.xianqiang wants to merge 2 commits from lei.xianqiang/vitastor:fix_io_uring_short_send into master

2 Commits

Author SHA1 Message Date
38d25bf8cf client: resend only the unsent tail after a short io_uring send
A short io_uring send (sendmsg/sendmsg_zc with MSG_WAITALL) used to
disconnect the peer. With large replies such as SEC_LIST filling the
socket buffer this happened repeatedly and caused endless re-peering.
Now the already accepted prefix stays on the zerocopy path and waits for
its release notification as usual, while only the unsent tail is resent
with a copying sendmsg before any new ops are appended. -EAGAIN/-EINTR
completions are handled the same way, as a zero-byte short send, instead
of leaving the batch stuck in send_list.
The send_free range of the short-written batch is recorded once, on its
first short send, and released only after both the tail is fully sent
and, for a zerocopy send, its release notification arrives.
Notifications of other batches are still released immediately, so none
of them can be lost and pin send_free.
2026-11-17 16:55:05 +08:00
cc798bd412 test: add a test tool for testing the send/reply of a single message 2026-11-17 16:54:49 +08:00