]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 5055 FATAL FwdState::noteDestinationsEnd exception: opening()
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Thu, 2 Jul 2020 13:57:57 +0000 (16:57 +0300)
committerEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Thu, 2 Jul 2020 13:57:57 +0000 (16:57 +0300)
The bug was caused by 25b0ce4.  Other symptoms are:

  assertion failed: store.cc:1793: "isEmpty()"
  assertion failed: FwdState.cc:501: "serverConnection() == conn"
  assertion failed: FwdState.cc:1037: "!opening()"

This happened because FwdState::connectStart() was called prematurely,
when the previous connection returned by HappyConnOpener is open
(but FwdState::connOpener is nil).

src/FwdState.cc

index c9fa449bcfe1b4ea5490cb556a550d74f3d49594..f97e0e554ac15965ecfd824be07cdb02545054b5 100644 (file)
@@ -579,7 +579,7 @@ FwdState::noteDestination(Comm::ConnectionPointer path)
 
     destinations->addPath(path);
 
-    if (Comm::IsConnOpen(serverConn)) {
+    if (destinationReceipt) {
         // We are already using a previously opened connection, so we cannot be
         // waiting for connOpener. We still receive destinations for backup.
         Must(!opening());
@@ -619,7 +619,7 @@ FwdState::noteDestinationsEnd(ErrorState *selectionError)
     // if all of them fail, forwarding as whole will fail
     Must(!selectionError); // finding at least one path means selection succeeded
 
-    if (Comm::IsConnOpen(serverConn)) {
+    if (destinationReceipt) {
         // We are already using a previously opened connection, so we cannot be
         // waiting for connOpener. We were receiving destinations for backup.
         Must(!opening());