Review the Cursor-authored io_uring Phase B: flip default to poll, harden uring, cleanups #16
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/yip!16
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/cursor-review-followups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
You asked me to review the Cursor-co-authored commits, clean up, and actually run the benchmarks. This PR is the result. The headline: the io_uring Phase B driver (#7) was the default on every modern Linux host, but it's slower and less robust than the epoll fallback it defaults over.
Benchmarks (re-run on this host, not trusting the committed numbers)
PollDriverio_uring delivers no measurable benefit and regresses the one metric it exists to improve. Mechanism: no SQPOLL (so it pays the same two syscalls epoll does, plus provided-buffer bookkeeping), and its GSO batching is a no-op (
MAX_GSO_SEGMENTS_PER_SEND = 1).Changes
1. Flip the default to
PollDriver(tunnel.rs). io_uring is now opt-in viaYIP_USE_URING=1(was: default-on, escape withYIP_FORCE_POLL). CI still gates both drivers innetns-tunnel-test.2. Harden the opt-in uring path — two robustness gaps a code review found, both departures from
poll.rs's contract:EINTRon the blocking ring wait (submit_and_wait) propagated and killed the tunnel;poll.rs's epoll loop retries it. Added anEINTR-retrying wrapper over both wait sites.ENETUNREACH/ECONNREFUSED/EBADF) forever. Now mirrorspoll.rsexactly via a per-slotSendKind: TUN writes always drop; UDP sends drop on transient buffer pressure (EAGAIN/EWOULDBLOCK/ENOBUFS) but propagate fatal errors.3. Cleanups + honest docs: removed a stray committed
task-7-report.md; re-measured & re-framed the bench README A/B section; README/CHANGELOG no longer present io_uring as the active latency mechanism; documented theMAX_GSO_SEGMENTS_PER_SEND=1GSO no-op as the first thing to fix before uring could earn the default back.Not done here (deliberately)
arq_recovers_bulk_loss(coalesced bursts were why it was capped to 1). Left as a documented follow-up; it needs its own re-benchmark.Verification
cargo build --workspace+clippy --all-targets -D warnings+ unit tests: green.🤖 Generated with Claude Code