You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/11/07 22:21:36 UTC
[trafficserver] branch master updated: Single nameserver failover
in DNSHandler
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new b0d6b78 Single nameserver failover in DNSHandler
b0d6b78 is described below
commit b0d6b78e1d1c5f14a3f7f41412492f2366c25fce
Author: Steven Feltner <sf...@godaddy.com>
AuthorDate: Mon Nov 6 18:43:31 2017 -0700
Single nameserver failover in DNSHandler
---
iocore/dns/DNS.cc | 7 ++++++-
iocore/dns/DNSConnection.cc | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index 0cfd573..823990d 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -483,7 +483,6 @@ DNSHandler::open_con(sockaddr const *target, bool failed, int icon, bool over_tc
Debug("dns", "open_con: opening connection %s", ats_ip_nptop(target, ip_text, sizeof ip_text));
if (cur_con.fd != NO_FD) { // Remove old FD from epoll fd
- cur_con.eio.stop();
cur_con.close();
}
@@ -719,6 +718,12 @@ DNSHandler::failover()
}
switch_named(name_server);
} else {
+ if (dns_conn_mode != DNS_CONN_MODE::TCP_ONLY) {
+ udpcon[0].close();
+ }
+ if (dns_conn_mode != DNS_CONN_MODE::UDP_ONLY) {
+ tcpcon[0].close();
+ }
ip_text_buffer buff;
Warning("failover: connection to DNS server %s lost, retrying", ats_ip_ntop(&ip.sa, buff, sizeof(buff)));
}
diff --git a/iocore/dns/DNSConnection.cc b/iocore/dns/DNSConnection.cc
index 223aef4..c13d0f0 100644
--- a/iocore/dns/DNSConnection.cc
+++ b/iocore/dns/DNSConnection.cc
@@ -62,6 +62,7 @@ DNSConnection::~DNSConnection()
int
DNSConnection::close()
{
+ eio.stop();
// don't close any of the standards
if (fd >= 2) {
int fd_save = fd;
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].