Repository navigation
fix(quic): ignore empty UDP datagrams in endpoint - #1070
Merged
Merged
Conversation
Empty UDP packets caused `buf.chunks(0)` to panic with "chunk size must be non-zero". Skip zero-length payloads before chunking, matching how quinn skips empty datagrams. Fixes compio-rs#1069
Berrysoft
approved these changes
Oct 4, 2026
Berrysoft
left a comment
Member
There was a problem hiding this comment.
LGTM. But seems created by LLM, and the author doesn't answer the questions.
Contributor
Author
|
Thanks for reviewing and merging, @Berrysoft! I appreciate the catch and review. To clarify, I use AI tooling in my workflow alongside local test reproduction and manual inspection. I'll make sure to monitor and respond to any questions much more promptly going forward. |
Open
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.
Problem
Receiving an empty UDP datagram panics the endpoint worker:
handle_datacallsbuf[..meta.len].chunks(meta.stride.min(meta.len)). Whenmeta.len == 0(empty UDP payload), that becomeschunks(0), which panics. Reproduced by sendingUdpSocket::send_to([], server_addr)at a running endpoint (see #1069).Solution
Return early from
handle_datawhenmeta.len == 0. Empty UDP datagrams are not valid QUIC packets, so there is nothing to process. This matches quinn's approach of skipping empty datagram buffers (while !data.is_empty()).Test
Added
empty_udp_packet_does_not_panicincompio-quic/tests/basic.rs: send an empty UDP packet to a server endpoint, then complete a normal handshake to confirm the worker is still alive.Fixes #1069