]> git.ipfire.org Git - thirdparty/squid.git/commit
Do not drop queued TCP DNS queries when queuing a new one (#1863)
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 15 Jul 2024 21:59:54 +0000 (21:59 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 15 Jul 2024 21:59:57 +0000 (21:59 +0000)
commit4216816eb481fb484e6dc8b28dab11babb0ccd87
tree173ba52a989c9546e19ade0455b5d615ec5c4dbd
parent334a9819a736156c8207530be0165f49c0ad0fa2
Do not drop queued TCP DNS queries when queuing a new one (#1863)

Since 2005 commit 032785bf, previously queued serialized DNS query
(waiting for a TCP connection to the nameserver or for a write on an
already established TCP connection) was erased every time a new query
was serialized and appended to the `vc->queue` MemBuf. Thus, at most one
TCP query was submitted when the nameserver became available.
Non-serialized versions of erased queries remained on the DNS lru_list
and would eventually be retried or timeout. This change restores
conditional MemBuf initialization that was replaced with an
unconditional MemBuf reset in that 2005 commit.

It would take more than 5 hours of 1000/s unique request load for
100-byte DNS queries to overflow a 2GB MemBuf in a properly functioning
Squid, but this change does not rely on MEM_BUF_MAX_SIZE always being
large enough. New code prevents MemBuf::grow() assertions and informs
the admin about dropped queries that may indicate a Squid bug or a
persistent problem with nameserver communication.
src/dns_internal.cc