MINOR: resolvers: Purge answer items when a SRV resolution triggers an error
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Mar 2021 14:46:46 +0000 (15:46 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 9 Apr 2021 14:02:26 +0000 (16:02 +0200)
When a SRV request trigger an error, if we decide to handle the error
because last_valid duration is expired, the answer list may be purged. All
items are considered as obsolete.

(cherry picked from commit 51d5e3bda7fb07a5f03cb878dd66f673c3ed1a59)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 720ed09b491f5005741115bd36855e05deb99481)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit f48a118811b27ee5dbdbe80603cc0fc7e9e4dbb3)
[cf: Must be backported as far as 2.0 because of recent changes on resolvers]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/server.c

index 512fa00..44d29ed 100644 (file)
@@ -4252,6 +4252,8 @@ int srvrq_resolution_error_cb(struct dns_requester *requester, int error_code)
                HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
        }
 
+       dns_purge_resolution_answer_records(res);
+
        return 1;
 }