Skip to content

fix(iroh): preserve relay receive outputs and retry after message drops - #4573

Open
Theodus wants to merge 1 commit into
n0-computer:mainfrom
Theodus:issue-4572
Open

Theodus wants to merge 1 commit into
n0-computer:mainfrom
Theodus:issue-4572

Conversation

@Theodus

@Theodus Theodus commented Oct 1, 2026

Copy link
Copy Markdown

Description

Fixes #4572.

RelayTransport::poll_recv indexed output slots by receive attempts. Dropping an oversized batch could leave a gap, causing the caller to miss a later usable message. If every attempt dropped data, the poll could also return Pending without requesting a wake for traffic still in the queue.

This change:

  • Index bufs, metas, and recv_infos by num_msgs, keeping usable outputs contiguous after drops.
  • Use continue instead of break after dropping an oversized single datagram.
  • Call cx.waker().wake_by_ref() when message drops exhaust the bufs.len() attempt limit, ensuring another poll.

API Changes

None.

Notes & open questions

The regression tests use 1,472-byte receive buffers and cover both oversized batches and oversized single datagrams:

  • One verifies that usable messages occupy consecutive output slots with the correct payloads, strides, and source addresses.
  • The other verifies the receive-attempt limit, a retry wake when message drops exhaust that limit, and no self-wake on an empty queue.

These tests replace the narrower oversized-batch progress test.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All API changes documented.
  • This PR was created by a human that thought critically about the
    proposed change and wrote as clear and concise a description as
    they could.
  • This PR isn't slop, and is carefully crafted to have the
    intended effect.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

Dropping oversized relay batches can skip valid messages and miss retry wakes

1 participant