Repository navigation
Fix the OpenBSD UDP send stall behind the routing-table smoke test failure - #7
Merged
Merged
Conversation
…rtable Dump the client's process state, both sides' stats endpoints, two seconds of the client's syscalls (ktrace) and the UDP sockets when a check fails, give the rtable path-up client its own log, and check a plain extra multipath path before the routing-table one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
Run the routing-table checks against a second server with noq's trace log, trace the client too, and capture the proxy port on lo0 and the egress interface, plus the UDP counters, all shown when a check fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
The path-up wait now also requires datagrams received on the path (from the client's stats), since the path can be reported up while its socket never receives. Run it against the shared server again (a fresh server did not reproduce the failure), with syscall traces of both processes instead of noq trace logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
Start the routing-table client straight after the previous client exits, with nothing attached, three times; trace the server and client only once a round has failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
A failed round showed a fresh client's handshake packets never reaching lo0 after the previous routing-table client exited. Probe plain UDP over loopback, dump pf rules, states and counters and the interface and IP drop counters, then disable pf and probe again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
In the failing rounds the server reads a fresh client's Initial packets but never answers. Log the server at debug level (handshake errors) and trace both processes' syscalls, with their CPU use, when a check fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
The failing rounds show the server going silent on every connection at once. Trace its syscalls from the first round on and show the first failing sendmsg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
OpenBSD fails a non-blocking UDP send with EAGAIN when another thread holds the socket's send buffer lock; noq's tokio sender then cleared write readiness and waited for a kqueue event that never comes, so the server went silent on every connection. Pin the fix branch and run six routing-table rounds, without tracing the server throughout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
Keep what the investigation showed is worth checking: the routing-table path must also receive on its own socket (not just be reported up), and back-to-back multipath rounds, which reproduced the server's stall every time before the noq fix. On failure show both sides' stats, process state, two seconds of syscalls and the UDP sockets; drop the always-on packet captures, pf probing and debug server log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
losfair
marked this pull request as ready for review
October 15, 2026 18:05
losfair/noq#4 merged as cad1d3a on dev (same tree as the PR head 2f590c1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run on OpenBSD (aarch64-unknown-openbsd, emulated)has failed at the routing-table (rtable) check since #5. The cause is neither routing tables nor arm64. On OpenBSD, noq's tokio UDP sender could stall for good, after which the server stopped sending on every connection.Root cause
The full analysis is in losfair/noq#4 (merged).
EAGAINwithout a full buffer. A non-blocking UDPsendmsgon OpenBSD fails withEAGAINwhenever another thread is insosendon the same socket. UnderMSG_DONTWAIT,sosenddoesn't sleep for the send-buffer lock.The smoke test's routing-table check was simply the first place that ran a multipath client long enough to hit the race. Emulated arm64 timing hit it most often.
Evidence (OpenBSD VMs, this PR's diagnostic runs)
sendmsg(10, …)calls. One returnserrno 35while the other completes. After that the server makes no moresendmsgcalls.recvmsgand nosendmsg.83433a2), both architectures passed 6 rounds.Changes
cad1d3aondev, the merged fix(noq): don't stall tokio UDP sends on OpenBSD send lock contention noq#4. It changes noq's tokio runtime only, on OpenBSD only..github/scripts/smoke-test.sh):/stats. Before, a path reported "up" was enough, and it can be reported up without ever receiving.Testing
cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo test(58 tests) pass with the new pin.83433a2, all CI jobs passed, including both OpenBSD jobs (6 rounds each). That commit pinned the PR head, which is identical to the merged commit.🤖 Generated with Claude Code
https://claude.ai/code/session_012baC35vUbLPPhuK4pz4uRz