Repository navigation
fix(udp): handle receive errors before truncation flags in recv_single - #884
Merged
Merged
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/884/docs/noq/ Last updated: 2026-11-04T16:46:46Z |
flub
approved these changes
Nov 4, 2026
(cherry picked from commit 462865a6c33039c26076f7077c7cd7e2f997b9cd)
(cherry picked from commit f2b3d32c059122e72370b55e091801d19aed676c)
rklaehn
force-pushed
the
rklaehn/fix-recv-single-trunc-spin
branch
from
November 4, 2026 16:41
57fc23f to
246ea3f
Compare
flub
enabled auto-merge
November 4, 2026 16:55
caiogondim
pushed a commit
to agent-habilis/noq
that referenced
this pull request
Nov 20, 2026
n0-computer#884) ## Description Fixes n0-computer#883. ## Notes & open questions These are just two cherry-picks. Still needs review from somebody familiar with the context. Verified that `recv_single_after_truncation_returns_would_block_instead_of_spin` fails without the fix (macOS). ## Change checklist - [x] Self-review. - [ ] ~~Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant.~~ - [x] Tests if relevant. - [ ] ~~All API changes documented.~~ - [x] This PR was created by a human that thought critically about the proposed change and wrote an as clear and concise description as they could. - [x] This PR isn't slop, and is carefully crafted to do have the intented effect. - [x] `cargo make` passes locally. --------- Co-authored-by: zerox80 <[email protected]> Co-authored-by: Dirkjan Ochtman <[email protected]> (cherry picked from commit 04807b6)
emrul
added a commit
to GetAster/noq
that referenced
this pull request
Nov 24, 2026
* upstream/main: (24 commits) refactor(proto): call the std-only float math through crate-root helpers (n0-computer#848) refactor(proto): Avoid PathId allocation when building PATH_ACKS (n0-computer#901) chore: Release chore(deps): fix unused crates warnings of rust 1.100 (n0-computer#899) chore: Update issue template checkboxes (n0-computer#897) chore: humantime is unmaintained (n0-computer#900) chore(ci): fix workflows for test binaries locations (n0-computer#896) fix(perf): don't enable qlog feature in perf binary (n0-computer#850) fix(proto): track the key update boundary per path (n0-computer#869) tests: additional stream affinity tests (n0-computer#890) feat: allow streams to set an affinity for a path, simple version (n0-computer#881) fix(udp): handle receive errors before truncation flags in recv_single (n0-computer#884) chore: Upgrade async-executor and allow warnings in patchbay build (n0-computer#888) chore: Use shared minimal-crates worksflow (n0-computer#862) tests: Increase local slow-tests timeout (n0-computer#860) fix(proto): keep unread data when compacting an unordered stream (n0-computer#867) fix(proto): coalesce contiguous chunks during defragment (n0-computer#866) deps: Bump tokio for RUSTSEC-2026-0386 (n0-computer#868) feat(proto): Implement `noq_proto::SendStream::set_affinity` (n0-computer#836) fix(ci): bump deps for illumos (n0-computer#856) ...
CommaBot
added a commit
to AFK-surf/monoid
that referenced
this pull request
Nov 26, 2026
Backport n0-computer/noq#884 (GHSA-6pp4-4cxf-xf88) into vendor/noq-udp. On Apple platforms, UdpSocketState defaults to recv_single. That function set up msghdr once outside the receive loop and checked MSG_TRUNC before errors. After one UDP datagram larger than the receive buffer (1472 bytes by default in noq-proto), later EAGAIN errors left MSG_TRUNC set. The receive thread then spun at 100% CPU while holding the endpoint mutex. - Reset msghdr via prepare_recv on every attempt inside retry_if_interrupted and check errors before MSG_TRUNC. - Map a zero-byte nameless EOF (SS_CANTRCVMORE) in recv_single and recv_via_recvmsg_x to WouldBlock instead of reading uninitialized sockaddr_storage or returning Ok(0). - Add unit and endpoint regression tests in vendor/noq-udp and station/native/mesh. - Document the vendored patch in vendor/README.md. Changelog: 修复:Apple 设备(macOS / iOS)收到超长 UDP 数据包后,mesh 收包线程在 noq-udp 中空转死循环导致严重发热与断连的问题 Changelog-parts: station, desktop Co-authored-by: Zhijian Xu <[email protected]>
CommaBot
added a commit
to AFK-surf/monoid
that referenced
this pull request
Nov 26, 2026
Backport n0-computer/noq#884 (GHSA-6pp4-4cxf-xf88) into vendor/noq-udp. On Apple platforms, UdpSocketState defaults to recv_single. That function set up msghdr once outside the receive loop and checked MSG_TRUNC before errors. After one UDP datagram larger than the receive buffer (1472 bytes by default in noq-proto), later EAGAIN errors left MSG_TRUNC set. The receive thread then spun at 100% CPU while holding the endpoint mutex. - Reset msghdr via prepare_recv on every attempt inside retry_if_interrupted and check errors before MSG_TRUNC. - Map a zero-byte nameless EOF (SS_CANTRCVMORE) in recv_single and recv_via_recvmsg_x to WouldBlock instead of reading uninitialized sockaddr_storage or returning Ok(0). - Add unit and endpoint regression tests in vendor/noq-udp and station/native/mesh. - Document the vendored patch in vendor/README.md. Changelog: 修复:Apple 设备(macOS / iOS)收到超长 UDP 数据包后,mesh 收包线程在 noq-udp 中空转死循环导致严重发热与断连的问题 Changelog-parts: station, desktop Co-authored-by: Zhijian Xu <[email protected]>
CommaBot
added a commit
to AFK-surf/monoid
that referenced
this pull request
Nov 26, 2026
…ms (#8897) Backport n0-computer/noq#884 (GHSA-6pp4-4cxf-xf88) into vendor/noq-udp. On Apple platforms, UdpSocketState defaults to recv_single. That function set up msghdr once outside the receive loop and checked MSG_TRUNC before errors. After one UDP datagram larger than the receive buffer (1472 bytes by default in noq-proto), later EAGAIN errors left MSG_TRUNC set. The receive thread then spun at 100% CPU while holding the endpoint mutex. - Reset msghdr via prepare_recv on every attempt inside retry_if_interrupted and check errors before MSG_TRUNC. - Map a zero-byte nameless EOF (SS_CANTRCVMORE) in recv_single and recv_via_recvmsg_x to WouldBlock instead of reading uninitialized sockaddr_storage or returning Ok(0). - Add unit and endpoint regression tests in vendor/noq-udp and station/native/mesh. - Document the vendored patch in vendor/README.md. Changelog: 修复:Apple 设备(macOS / iOS)收到超长 UDP 数据包后,mesh 收包线程在 noq-udp 中空转死循环导致严重发热与断连的问题 Changelog-parts: station, desktop Co-authored-by: Zhijian Xu <[email protected]>
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 #883.
Notes & open questions
These are just two cherry-picks. Still needs review from somebody familiar with the context.
Verified that
recv_single_after_truncation_returns_would_block_instead_of_spinfails without the fix (macOS).Change checklist
Documentation updates following the style guide, if relevant.All API changes documented.proposed change and wrote an as clear and concise description as
they could.
intented effect.
cargo makepasses locally.