Skip to content

fix(quinn-udp): drain full batch on partial sendmsg_x (Apple)#2

Draft
jamilbk wants to merge 1 commit into
mainfrom
fix/apple-sendmsg-x-partial-send
Draft

fix(quinn-udp): drain full batch on partial sendmsg_x (Apple)#2
jamilbk wants to merge 1 commit into
mainfrom
fix/apple-sendmsg-x-partial-send

Conversation

@jamilbk

@jamilbk jamilbk commented Jun 7, 2026

Copy link
Copy Markdown
Member

sendmsg_x behaves like sendmmsg: it delivers as many messages as the interface queue accepts and returns that count, which can be fewer than requested when the queue fills mid-batch. The Apple fast-datapath send discarded the count and always returned Ok(()), silently dropping the un-sent tail of a partially-sent batch. Under load this shows up as upstream UDP loss (and collapsed TCP throughput) with no NIC-level drops.

Loop until the whole batch is drained, surfacing the error only when no messages were sent so the caller can still back-pressure on ENOBUFS.

`sendmsg_x` behaves like `sendmmsg`: it delivers as many messages as the
interface queue accepts and returns that count, which can be fewer than
requested when the queue fills mid-batch. The Apple fast-datapath send
discarded the count and always returned `Ok(())`, silently dropping the
un-sent tail of a partially-sent batch. Under load this shows up as
upstream UDP loss (and collapsed TCP throughput) with no NIC-level drops.

Loop until the whole batch is drained, surfacing the error only when no
messages were sent so the caller can still back-pressure on `ENOBUFS`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jamilbk
jamilbk force-pushed the fix/apple-sendmsg-x-partial-send branch from 8495fca to 0cc05e7 Compare June 7, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant