MINOR: resolvers: Don't try to match immediatly renewed ADD items
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Mar 2021 15:42:45 +0000 (16:42 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 16 Mar 2021 08:59:20 +0000 (09:59 +0100)
commit27c8d7a5321ba0a091da5e0dc56911135c24d8a3
treedfd2e03fd1116fe4f2a2159b3cfacaf714bb141a
parent8b6d5b0b753594b61ea95c56bcbe93117506fdf0
MINOR: resolvers: Don't try to match immediatly renewed ADD items

The loop looking for existing ADD items to renew their last_seen must ignore
the items already renewed in the same loop. To do so, we rely on the
last_seen time. because it is now based on now_ms, it is safe.

Doing so avoid to match several time the same ADD item when the same IP
address is found in several ADD item. This reduces the number of extra DNS
resolutions.

This patch depends on "MINOR: resolvers: Use milliseconds for cached items
in resolver responses". Both may be backported as far as 2.2 if necessary.

(cherry picked from commit e8674c71840cd783d6ba1cc073c0d074aea09fd8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/dns.c