]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 3556: "FD ... is not an open socket" for accept() problems (#777)
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 19 Feb 2021 16:14:37 +0000 (16:14 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 22 Feb 2021 01:41:12 +0000 (01:41 +0000)
commit9205b24a4029f2ca569f5e92c8247d2ac1ecc0c6
treeed746c99a9d6bb4133c83d4ccad1f1a92242cc21
parent1f8b5f0e1cc27634a7310be4c9674112f919d974
Bug 3556: "FD ... is not an open socket" for accept() problems (#777)

Many things could go wrong after Squid successfully accept(2)ed a socket
and before that socket was registered with Comm. During that window, the
socket is stored in a refcounted Connection object. When that object was
auto-destroyed on the error handling path, its attempt to auto-close the
socket would trigger level-1 BUG 3556 errors because the socket was not
yet opened from Comm point of view. This change eliminates that "already
in Connection but not yet in Comm" window.

The fixed BUG 3556 errors stalled affected clients and leaked their FDs.

TODO: Keeping that window closed should not require a human effort, but
achieving that goal probably requires significant changes. We are
investigating.
src/comm/TcpAcceptor.cc