mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-18 04:55:37 +00:00
BUG/MINOR: resolvers: do not run the timeout task when there's no resolution
The function resolv_update_resolvers_timeout() always schedules a wakeup of the process_resolvers() task based on the "timeout resolve" setting, regardless of the presence of an ongoing resolution or not. This is causing one wakeup every second by default even when there's no resolvers section (due to the default one), and can even be worse: creating a section with "timeout resolve 1" bombs the process with 1000 wakeups per second. Let's condition the setting to the presence of a resolution to address this. This issue has been there forever, but it doesn't cause that much trouble, and given how fragile and tricky this code is, it's probably wise to refrain from backporting it until it's reported to really cause trouble.
This commit is contained in:
parent
28ea31c7cb
commit
fdecaf6ae4
@ -286,11 +286,11 @@ static inline int resolv_resolution_timeout(struct resolv_resolution *res)
|
||||
static void resolv_update_resolvers_timeout(struct resolvers *resolvers)
|
||||
{
|
||||
struct resolv_resolution *res;
|
||||
int next;
|
||||
int next = TICK_ETERNITY;
|
||||
|
||||
next = tick_add(now_ms, resolvers->timeout.resolve);
|
||||
if (!LIST_ISEMPTY(&resolvers->resolutions.curr)) {
|
||||
res = LIST_NEXT(&resolvers->resolutions.curr, struct resolv_resolution *, list);
|
||||
next = tick_add(now_ms, resolvers->timeout.resolve);
|
||||
next = MIN(next, tick_add(res->last_query, resolvers->timeout.retry));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user