From ffc723c49fab24b748400d98c759b655125dfc3c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 20:39:01 +0200 Subject: [PATCH] Leave the repair queue bounded by the repair budget alone The extra room cap on queued repairs had no test and no owner beyond the budget and the frame deadline, which already bound the queue. Co-Authored-By: Claude Opus 5.5 --- crates/muninn-daemon/src/media_send.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/muninn-daemon/src/media_send.rs b/crates/muninn-daemon/src/media_send.rs index b6b58f1..08ce12f 100644 --- a/crates/muninn-daemon/src/media_send.rs +++ b/crates/muninn-daemon/src/media_send.rs @@ -793,9 +793,8 @@ impl MediaSendCore { now, )?; let requested = repairs.len(); - let room = REPAIR_CACHE_CHUNKS.saturating_sub(self.repairs.len()); let allowed = self.repair_budget.take( - requested.min(REPAIR_MAX_CHUNKS_PER_POLL).min(room), + requested.min(REPAIR_MAX_CHUNKS_PER_POLL), now, self.stats.groups_lost(), ); @@ -806,7 +805,8 @@ impl MediaSendCore { .saturating_add(requested.saturating_sub(allowed) as u64); // Repairs are queued for the receiver that asked, not for // everyone; the send step sends each one inside the - // deadline of its own frame, after any waiting audio. + // deadline of its own frame, after any waiting audio. The + // queue is bounded by the repair budget times the deadline. self.repairs.extend( repairs .into_iter()