]> git.ipfire.org Git - thirdparty/squid.git/commit
Do not unconditionally revive dead peers after a DNS refresh.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 29 May 2017 00:18:24 +0000 (12:18 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 29 May 2017 00:18:24 +0000 (12:18 +1200)
commit2d2918bf28d181b579f873333477c444dc028445
tree222200af480ce9e59bc5e6ae4ba0b32df120bed4
parent6efab9221753d1b9942e6c5c373dfe5ad1f617e7
Do not unconditionally revive dead peers after a DNS refresh.

Every hour, peerRefreshDNS() performs a DNS lookup of all cache_peer
addresses. Before this patch, even if the lookup results did not change,
the associated peerDNSConfigure() code silently cleared dead peer
marking (CachePeer::tcp_up counter), if any.  Forcefully reviving dead
peers every hour can lead to transaction delays (and delays may lead to
failures) due to connection timeouts when using a still dead peer.

This patch starts standard TCP probing (instead of pointless dead peer
reviving), correctly refreshing peer state.  The primary goal is to
cover a situation where a DNS refresh changes the peer address list.
However, TCP probing may be useful for other situations as well and has
low overhead (that is why it starts unconditionally). For example,
probing may be useful when the DNS refresh changes the order of IP
addresses. It also helps detecting dead idle peers.

Also delay and later resume peer probing if peerDNSConfigure() is
invoked when peers are being probed. Squid should re-probe because the
current probes may use stale IP addresses and produce wrong results.
src/CachePeer.cc
src/CachePeer.h
src/neighbors.cc