Repository navigation
fix(iroh): stop caching the IP sockets' GSO limit in TransportsSender - #4645
Open
ThierryCantin-Demers wants to merge 3 commits into
Open
ThierryCantin-Demers wants to merge 3 commits into
ThierryCantin-Demers wants to merge 3 commits into
Conversation
noq-udp lowers a socket's max_gso_segments to 1 after the kernel refuses a segmented send, but TransportsSender kept the limit it read when the connection was created, so open connections kept sending batches that failed and timed out. Refs n0-computer#4555
2 tasks done
On Linux a loopback send with more segments than UDP_MAX_SEGMENTS fails with EINVAL, which noq-udp handles like the EIO of a NIC without checksum offload, so the stale-limit path from n0-computer#4555 runs without special hardware. Fails on main with 64 against 1.
ThierryCantin-Demers
marked this pull request as ready for review
October 27, 2026 19:26
This branch has not been deployed
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.
Description
Fixes #4555. After the kernel refuses a GSO send, noq-udp lowers the socket's
max_gso_segmentsto 1, butTransportsSenderkept the limit it read when it was created, so open connections kept sending batches that failed until they timed out.TransportsSendernow reads the IP sockets' limit on everymax_transmit_segments()call. Only the custom transports' limit stays stored:CustomSendercannot report one, and changing that trait is outside this fix.The code was written by Claude and reviewed by me.
API Changes
None.
Notes & open questions
max_transmit_segments()once perdrive_transmit, and each call adds one read of each IP socket'sRwLock, whichpoll_sendalready takes once per transmit.iroh-benchshows no measurable difference.UDP_MAX_SEGMENTSfail with EINVAL, which noq-udp handles like the EIO from the issue, so the test needs only loopback. Against main's stored limit, its assertion sees 64 instead of 1.Benchmarks
iroh-bench bulkover loopback, 2 GiB per run, main and this PR alternating, 9 runs each, MiB/s as median (slowest to fastest run). The ranges overlap in every row:Burn's remote backend: a client on another machine trains MNIST for one epoch on the affected machine's GPU, over one iroh connection with relays disabled, so every tensor goes over that direct UDP path:
Change checklist