Skip to content

Refs #984: sendpacket bounded EAGAIN/ENOBUFS retry (merges #986 + fixups)#996

Merged
fklassen merged 1 commit into
Bug_#984_endless_retries_on_ENOBUFS_EAGAINfrom
worktree-pr-986-enobufs-retry
Jul 16, 2026
Merged

Refs #984: sendpacket bounded EAGAIN/ENOBUFS retry (merges #986 + fixups)#996
fklassen merged 1 commit into
Bug_#984_endless_retries_on_ENOBUFS_EAGAINfrom
worktree-pr-986-enobufs-retry

Conversation

@fklassen

@fklassen fklassen commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Known follow-up (not addressed here)

The retry bound is shared by every backend that jumps to TRY_SEND_AGAIN, including netmap's ring-full retry signal (retcode == -2), which is a legitimate/expected condition rather than a true error and could plausibly need more than 100 spins under bursty load. Flagging for maintainers to decide whether netmap needs its own/larger limit — out of scope for this PR, which targets the PF_PACKET/general EAGAIN/ENOBUFS hang from #984.

Test plan

  • ../autogen.sh && ../configure --disable-local-libopts --enable-debug && make — builds clean, no warnings, out-of-tree on macOS (BPF backend).
  • Manual verification on Linux PF_PACKET per Refs #984: sendpacket: avoid endless retries on ENOBUFS/EAGAIN #986's repro steps (replay a pcap that triggers persistent ENOBUFS/EAGAIN) — not done in this environment.
  • test/ regression case for the retry cap — none exists yet; not added here.

🤖 Generated with Claude Code

…loop

Merges PR #986 (Yaroslav / d3156) which fixed sendpacket() spinning
forever on transient EAGAIN/ENOBUFS under sustained buffer pressure,
plus review fixups:

- usleep(0) doesn't actually sleep on any target libc; use a real
  100us backoff between retries (matches src/common/txring.c's
  existing usleep(100) convention) so the bound also curbs CPU/kernel
  load, not just loop count.
- Set an explicit error message via sendpacket_seterr() when the
  retry cap is hit, so callers reading sendpacket_geterr() get an
  accurate reason instead of a stale/empty errbuf.
- Fix EXIT_MAX_RETRIES label indentation to match the existing
  TRY_SEND_AGAIN label, and drop the trailing-whitespace blank line.

Refs #984.

Co-Authored-By: Yaroslav <d3156@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fklassen
fklassen changed the base branch from Bug_#984_endless_retries_on_ENOBUFS_EAGAIN to v4.5.3-beta1 July 16, 2026 18:24
@fklassen
fklassen marked this pull request as ready for review July 16, 2026 18:25
@fklassen
fklassen changed the base branch from v4.5.3-beta1 to Bug_#984_endless_retries_on_ENOBUFS_EAGAIN July 16, 2026 18:31
@fklassen
fklassen merged commit 426706a into Bug_#984_endless_retries_on_ENOBUFS_EAGAIN Jul 16, 2026
2 checks passed
@fklassen
fklassen deleted the worktree-pr-986-enobufs-retry branch July 16, 2026 18:32
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.

2 participants