From: Henrik Nordstrom Date: Mon, 7 Apr 2008 22:38:10 +0000 (+0200) Subject: Make IdleConn::removeFd err on the soft site if the fd could not be found X-Git-Tag: SQUID_3_1_0_1~49^2~306 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f500ce3b0b824acb4ceea70a198e1457ff75ab1;p=thirdparty%2Fsquid.git Make IdleConn::removeFd err on the soft site if the fd could not be found this fixes the assert seen by Tsantilas Christos. It's not really a proper fix to the underlying problem, but at least makes Squid surive. The actual problem is race windows introduced by the async call queue. In this case both "closed by remote server" and "timeout" events may get queued at the same time, or to be specific the "closed by remote server" read event stays in the queue and gets called even after pconn has deregistered interest in the event. --- diff --git a/src/pconn.cc b/src/pconn.cc index f8f2e4bc11..229657da81 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -86,7 +86,10 @@ void IdleConnList::removeFD(int fd) { int index = findFDIndex(fd); - assert(index >= 0); + if (index < 0) { + debugs(48, 0, "IdleConnList::removeFD: FD " << fd << " NOT FOUND!"); + return; + } debugs(48, 3, "IdleConnList::removeFD: found FD " << fd << " at index " << index); for (; index < nfds - 1; index++)