]> git.ipfire.org Git - thirdparty/squid.git/commit
Happy Eyeballs: Do not discard viable reforwarding destinations (#567)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Thu, 23 Apr 2020 05:12:27 +0000 (05:12 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 23 Apr 2020 18:30:20 +0000 (18:30 +0000)
commita4d576deb4f3ce744211ac4a973f1dd2b9f12a34
tree73ec8baedbeffa78ea4e245618311cae6393b43d
parent3ca51df96daea88de949c2678dc84906805a4f4e
Happy Eyeballs: Do not discard viable reforwarding destinations (#567)

When HappyConnOpener starts opening two connections, both destinations
are removed from the shared destinations list. As soon as one connection
(X) succeeded, the other destination (Y) was essentially forgotten. If
FwdState, after using X, decided to reforward the request, then the
request was never reforwarded to Y. We now return Y to the list.

Also abort the still-active ConnOpener job upon the termination of its
"parent" HappyConnOpener job. Without an explicit termination, those
abandoned child jobs wasted OS and Squid resources while the OS was
trying to open the requested connection. They would terminate on a
timeout or when the connection was finally opened (and discarded).

Waiting for the child ConnOpener job to end is a useful optimization,
but it remains a TODO. It requires complex accumulation avoidance logic.

Also fixed retrying via FwdState::fail() which could reorder addresses.
It incorrectly assumed that only the prime connections were retried.
src/HappyConnOpener.cc
src/HappyConnOpener.h
src/ResolvedPeers.cc
src/ResolvedPeers.h
src/comm/forward.h