[squid-dev] [PATCH] Bug3329

Tsantilas Christos chtsanti at users.sourceforge.net
Mon May 25 10:13:15 UTC 2015


Hi all,

   I am attaching new squid patches for bug3329.

The problem caused because under some circumstances the corresponding 
fde object is closed and marked as closed but the peer Comm::Connection 
object of two pinned connections is still open (Comm::Connection.fd >= 0).

The patches attached in bugzilla report are still a workaround but still 
have a major problem: The comm_close handler is not the best place to 
close a connection. The comm_close handler called because the connection 
is already closed!

To fix this problem, we must not allow Comm::Connections to get out
of sync with fd_table, even when a descriptor is closed without going
through Connection::close(). There are two ways to accomplished that:

   * Change Comm to always store Comm::Connections and similar 
high-level objects instead of fdes. This is a huge change that has been 
long on the TODO list (those "other high-level objects" is on of the 
primary obstacles there because not everything with a FD is a Connection).

   * Notify Comm::Connections about closure in their closing handler 
(this change). This design relies on every Comm::Connection having a 
close handler that notifies it. It may take us some time to reach that 
goal, but this change is the first step providing the necessary API, a 
known bug fix, and a few preventive changes.

This patch:
   - Adds a new Comm::Connection::noteClosure() method to inform the 
Comm::Connection object that somebody is closing its FD.

   - Uses the new method inside 
ConnStateData::clientPinnedConnectionClosed handler to inform the 
ConnStateData::pinning::serverConnection object that its FD is being closed.

   - Replaces comm_close calls which may cause bug #3329 in other places 
with Comm::Connection->close() calls.

Initially based on Nathan Hoad research for bug 3329.
This is a Measurement Factory project.

Regards,
      Christos

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug3329-squid-3.5-t5.patch
Type: text/x-patch
Size: 12896 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150525/47d08062/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug3329-trunk-t5.patch
Type: text/x-patch
Size: 12205 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150525/47d08062/attachment-0001.bin>


More information about the squid-dev mailing list