This commit is contained in:
Eitan Seri-Levi
2026-05-24 11:18:27 +03:00
parent 0e99b454a3
commit eaa5caf778

View File

@@ -586,22 +586,16 @@ impl<S: SlotClock> ReprocessQueue<S> {
return; return;
} }
// When the queue is full, evict the oldest entry to make room for newer envelopes. // When the queue is full, drop the new envelope.
if self.awaiting_envelopes_per_root.len() >= MAXIMUM_QUEUED_ENVELOPES { if self.awaiting_envelopes_per_root.len() >= MAXIMUM_QUEUED_ENVELOPES {
if self.envelope_delay_debounce.elapsed() { if self.envelope_delay_debounce.elapsed() {
warn!( warn!(
queue_size = MAXIMUM_QUEUED_ENVELOPES, queue_size = MAXIMUM_QUEUED_ENVELOPES,
msg = "system resources may be saturated", msg = "system resources may be saturated",
"Envelope delay queue is full, evicting oldest entry" "Envelope delay queue is full, dropping envelope"
); );
} }
if let Some(oldest_root) = return;
self.awaiting_envelopes_per_root.keys().next().copied()
&& let Some((_envelope, delay_key)) =
self.awaiting_envelopes_per_root.remove(&oldest_root)
{
self.envelope_delay_queue.remove(&delay_key);
}
} }
// Register the timeout. // Register the timeout.