Skip to content

let one refused datagram fail without stalling the batch - #18

Merged
aotodev merged 1 commit into
masterfrom
6-a-failed-flush-keeps-references-the-echo-pattern-then-overwrites
Oct 2, 2026
Merged

aotodev merged 1 commit into
masterfrom
6-a-failed-flush-keeps-references-the-echo-pattern-then-overwrites

Conversation

@aotodev

@aotodev aotodev commented Oct 2, 2026

Copy link
Copy Markdown
Owner

sendmmsg stops at the first datagram it cannot send. flush returned that
error and left the whole batch staged, so a destination the kernel
always refuses (EMSGSIZE, EPERM, EHOSTUNREACH) failed every later flush
and stopped replies to everyone. A short send dropped its tail even
when it stopped on EAGAIN. In the echo pattern a failed flush also kept
references to receive slots that the next receive overwrote, sending
new peers' bytes to old peers.

flush now returns a flushed report. An error that belongs to one
datagram drops that entry and the rest still go. An error that belongs
to the socket (EAGAIN, ENOBUFS, EINTR, EBADF, ...) stops the flush and
keeps everything unsent staged, in order, behind a head offset. The
error classification lives in detail::send_all, tested against scripted
sendmmsg results. The echo example and README discard after a stall.

Breaking: flush returns flushed instead of resultstd::size_t.

@aotodev aotodev linked an issue Oct 2, 2026 that may be closed by this pull request
@aotodev
aotodev merged commit 7ef6917 into master Oct 2, 2026
7 checks passed
@aotodev
aotodev deleted the 6-a-failed-flush-keeps-references-the-echo-pattern-then-overwrites branch October 2, 2026 11:10
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.

A failed flush keeps references the echo pattern then overwrites

1 participant