]> git.ipfire.org Git - thirdparty/squid.git/commit
Fixed several ConnOpener problems
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 9 Feb 2013 06:36:36 +0000 (23:36 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Feb 2013 06:36:36 +0000 (23:36 -0700)
commit4f1108997e98a1897ed882ed9b01bf99d975239a
tree8bbfb6fd6a7a325d1c4de96e9e0678f61c45c547
parent0a12af574dbeeb0c502b35f5b24fb803292eda33
Fixed several ConnOpener problems

... by relying on AsyncJob protections and comm_close(), while maintaining a
tighter grip on various I/O and sleep states.

Problems addressed:

* Connection descriptor was not closed when attempting to reconnect after
  failures. We now properly close on failures, sleep with descriptor closed,
  and then reopen.

* Timeout handler was not cleaned up properly in some cases, causing memory
  leaks (for the handler Pointer) and possibly timeouts that were fired (for
  then-active handler) after the connection was passed to the initiator.

* Comm close handler was not cleaned up properly.

* statCounter.syscalls.sock.closes counter was not updated on FD closure.

* Waiting pending accepts were not kicked on FD closure.

* Connection timeout was enforced for each connection attempt instead of
  applying to all attempts taken together.

and possibly other problems. The full extent of all side-effects of mishandled
race conditions and state conflicts is probably unknown.
src/comm/ConnOpener.cc
src/comm/ConnOpener.h