Skip to content

Keep valid packets when another source has timed out - #81

Merged
stewartadam merged 1 commit into
mainfrom
claude/project-thread-0t11p6-1-keep-packet-on-timeout
Nov 12, 2026
Merged

stewartadam merged 1 commit into
mainfrom
claude/project-thread-0t11p6-1-keep-packet-on-timeout

Conversation

@stewartadam

@stewartadam stewartadam commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With announce_timeout enabled, check_seq_number ran the global timeout check and returned the first UniverseTimeout it found. That error replaced the result for the packet being checked, so a valid packet from source A was dropped whenever some other source B had timed out.

Fix

  • SacnReceiver::recv already runs the timeout check (and announces timeouts) before every socket read. check_seq_number now only prunes timed-out entries itself when timeouts are not being announced.
  • If the packet's own source/universe entry has timed out but hasn't been removed yet, it's treated as a new universe for that source. Otherwise a source that restarts its sequence could be rejected as out of sequence.

Tests

Two unit tests in receive.rs:

  • an in-sequence packet is accepted while another source's entry has expired, and the expired entry is left for recv to report;
  • a packet after the source's own entry expired is accepted even though its sequence number falls in the discard window.

cargo test --lib passes.

This touches the same function as the fix for the inverted break in check_timeouts. That fix changes a different part of the file, so the two shouldn't conflict.

check_seq_number ran the global timeout check with announce_timeout set,
so a UniverseTimeout for any source was returned in place of the packet
being checked and that packet was lost. Timeouts are already reported by
recv before each read, so only prune here when they aren't announced.

A timed out entry that hasn't been removed yet is now treated as a new
universe for that source, so a restarted source isn't rejected as out of
sequence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzaQVPkrkczgX2g7wGkip5
@stewartadam stewartadam self-assigned this Nov 12, 2026
@stewartadam
stewartadam merged commit 9c050de into main Nov 12, 2026
4 checks passed
@stewartadam
stewartadam deleted the claude/project-thread-0t11p6-1-keep-packet-on-timeout branch November 12, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants