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;
}
// 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.envelope_delay_debounce.elapsed() {
warn!(
queue_size = MAXIMUM_QUEUED_ENVELOPES,
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) =
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);
}
return;
}
// Register the timeout.