]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: dns: inapropriate way out after a resolution timeout
authorBaptiste Assmann <bedis9@gmail.com>
Wed, 6 Jan 2016 00:53:46 +0000 (01:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Apr 2016 03:56:11 +0000 (05:56 +0200)
A bug leading HAProxy to stop DNS resolution when multiple servers are
configured and one is in timeout, the request is not resent.
Current code fix this issue.

backport status: 1.6 and above

src/dns.c

index 1ce786dc5bab175a34d89d22fe578b87e3477fa2..97f9f0ac0d26bdbf5b38f4838d65a9142123e5c3 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -1188,21 +1188,19 @@ struct task *dns_process_resolve(struct task *t)
 
                        /* notify the result to the requester */
                        resolution->requester_error_cb(resolution, DNS_RESP_TIMEOUT);
+                       goto out;
                }
 
                resolution->try -= 1;
 
-               /* check current resolution status */
-               if (resolution->step == RSLV_STEP_RUNNING) {
-                       /* resend the DNS query */
-                       dns_send_query(resolution);
+               /* resend the DNS query */
+               dns_send_query(resolution);
 
-                       /* check if we have more than one resolution in the list */
-                       if (dns_check_resolution_queue(resolvers) > 1) {
-                               /* move the rsolution to the end of the list */
-                               LIST_DEL(&resolution->list);
-                               LIST_ADDQ(&resolvers->curr_resolution, &resolution->list);
-                       }
+               /* check if we have more than one resolution in the list */
+               if (dns_check_resolution_queue(resolvers) > 1) {
+                       /* move the rsolution to the end of the list */
+                       LIST_DEL(&resolution->list);
+                       LIST_ADDQ(&resolvers->curr_resolution, &resolution->list);
                }
        }