]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix HappyConnOpener::checkForNewConnection Must(prime) violation (#923)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 31 Oct 2021 01:37:23 +0000 (01:37 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 31 Oct 2021 02:23:24 +0000 (02:23 +0000)
commitfbc253f2323689884f585837008afe0e6f7023bf
tree0699802a738361acf05955e6b75575703bcc9e99
parent40dc90df00a73f90fbce3e34ae76d133996ee80a
Fix HappyConnOpener::checkForNewConnection Must(prime) violation (#923)

This change addresses a known problem that triggered unwanted C++
exceptions every time Squid selected a to-server persistent connection
as the primary Happy Eyeballs destination/answer. The bug existed since
HappyConnOpener inception (commit 5562295). It did not seem to affect
the connection requestor directly because the HappyConnOpener job sends
the selected pconn to the requestor _before_ throwing.

Also adjusted Happy Eyeballs state documentation to reflect a successful
termination state. Before and after this change, we may enter that state
in the middle of checkForNewConnection(). The less we think about done()
as an _exceptional_ "only on error" or "only at the end of processing"
state, the fewer similar bugs we will create.

The code also improved after we abandoned the idea of documenting all
primary state changes in checkForNewConnection(). There are too many
nuances/changes to document everything anyway, and moving primary track
handling into a dedicated function significantly improves readability.
src/HappyConnOpener.cc
src/HappyConnOpener.h