mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
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:
parent
e0f4717727
commit
142cc1b52a
@ -2451,9 +2451,19 @@ struct task *process_resolvers(struct task *t, void *context, unsigned int state
|
|||||||
LIST_APPEND(&resolvers->resolutions.wait, &res->list);
|
LIST_APPEND(&resolvers->resolutions.wait, &res->list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resolv_update_resolvers_timeout(resolvers);
|
resolv_update_resolvers_timeout(resolvers);
|
||||||
HA_SPIN_UNLOCK(DNS_LOCK, &resolvers->lock);
|
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 */
|
/* now we can purge all queued deletions */
|
||||||
leave_resolver_code();
|
leave_resolver_code();
|
||||||
return t;
|
return t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user