BUG/MINOR: resolvers: Wakeup DNS idle task on stopping

Thanks to previous commit ("BUG/MEDIUM: dns: Kill idle DNS sessions during
stopping stage"), DNS idle sessions are killed on stopping staged. But the
task responsible to kill these sessions is running every 5 seconds. It
means, when HAProxy is stopped, we can observe a delay before the process
exits.

To reduce this delay, when the resolvers task is executed, all DNS idle
tasks are woken up.

This patch must be backported as far as 2.6.
This commit is contained in:
Christopher Faulet 2023-04-11 07:58:27 +02:00
parent e0f4717727
commit 142cc1b52a

View File

@ -2451,9 +2451,19 @@ struct task *process_resolvers(struct task *t, void *context, unsigned int state
LIST_APPEND(&resolvers->resolutions.wait, &res->list);
}
}
resolv_update_resolvers_timeout(resolvers);
HA_SPIN_UNLOCK(DNS_LOCK, &resolvers->lock);
if (unlikely(stopping)) {
struct dns_nameserver *ns;
list_for_each_entry(ns, &resolvers->nameservers, list) {
if (ns->stream)
task_wakeup(ns->stream->task_idle, TASK_WOKEN_MSG);
}
}
/* now we can purge all queued deletions */
leave_resolver_code();
return t;