]> git.ipfire.org Git - thirdparty/squid.git/commit
Support IpcIO timeouts.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 3 Feb 2011 05:33:05 +0000 (22:33 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 3 Feb 2011 05:33:05 +0000 (22:33 -0700)
commitcaca86d7e35c502dbcf4d9a6d409fa19f066354f
tree9cf0471066c0c448cb5ce07a4897e56f5266db3a
parent1adea2a655e4479e2682f5ae157dd19686f6153c
Support IpcIO timeouts.

Penging IpcIo requests are now stored in two alternating maps: "old" and
"new".  Every T seconds, any requests remaining in the "old" map are treated
as timed out.  After that check, the current "new" and (now empty) "old" map
pointers are swapped so that the previously "new" requests can now age for T
seconds.  New requests are always added to the "new" map. Responses are
always checked against both maps.

This approach gives us access to pending request information and allows to
report errors to the right I/O requestors without creating additional
per-request state attached to a per-request timeout event. The price is (a)
two instead of one map lookups when the response comes and (b) timeout
precision decrease from "about T" to "anywhere from T to 2*T".
src/DiskIO/IpcIo/IpcIoFile.cc
src/DiskIO/IpcIo/IpcIoFile.h