mirror of
https://github.com/mailscope/kumomta.git
synced 2026-10-30 01:56:52 +00:00
ready_queue: maintainer_task: run a couple of times on startup
I've seen some flakey behavior in some of the low traffic integration tests, where it looks like the maintainer isn't triggering to establish connections. This commit adjusts the logic in the maintainer_task to trigger the maintainer a handful of times over the first few seconds of its life to account for timing issues when setting up a new ready queue on a busy server.
This commit is contained in:
@@ -241,12 +241,15 @@ impl ReadyQueueManager {
|
||||
// enqueued. In that case we don't notice the wakup on
|
||||
// `notify` in a timely manner and we'll sit waiting
|
||||
// for a subsequent message.
|
||||
{
|
||||
// We'll do this a couple of times at startup before
|
||||
// falling into the main loop below
|
||||
for _ in 0..4 {
|
||||
let mgr = Self::get().await;
|
||||
if let Some(queue) = mgr.queues.get(&name).cloned() {
|
||||
let mut queue = queue.lock().await;
|
||||
queue.maintain().await;
|
||||
}
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user