]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Tue, 16 Jul 2024 16:03:34 +0000 (04:03 +1200)
commit7304a2e31f08ec4d18f31898a1fcc497080a949c
treefe5af8b0bf0ed735b99bcb6f8045d9ff5c7dd12a
parentf8e9ce2eef1c5c7739ce578ebb21985bab049327
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