From 07e72f8ed28062f11985d9ef41a889f2421ab0fe Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Tue, 6 Sep 2011 11:37:29 -0600 Subject: [PATCH] Log ICAP_ERR_GONE ICAP transaction outcome when ICAP initiator disappears early. In this case, "early" means "before the end of the ICAP transaction". Previously, "catch all" ICAP_ERR_UNKNOWN outcome was logged into the adaptation log in such cases, raising red flags that there is something wrong with the ICAP service or Squid. --- src/adaptation/icap/Elements.cc | 1 + src/adaptation/icap/Elements.h | 1 + src/adaptation/icap/Xaction.cc | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/adaptation/icap/Elements.cc b/src/adaptation/icap/Elements.cc index 17a26130d7..ac82c70ad4 100644 --- a/src/adaptation/icap/Elements.cc +++ b/src/adaptation/icap/Elements.cc @@ -8,6 +8,7 @@ namespace Icap { const XactOutcome xoUnknown = "ICAP_ERR_UNKNOWN"; +const XactOutcome xoGone = "ICAP_ERR_GONE"; const XactOutcome xoRace = "ICAP_ERR_RACE"; const XactOutcome xoError = "ICAP_ERR_OTHER"; const XactOutcome xoOpt = "ICAP_OPT"; diff --git a/src/adaptation/icap/Elements.h b/src/adaptation/icap/Elements.h index ec78a55f6c..1e9ad8e18c 100644 --- a/src/adaptation/icap/Elements.h +++ b/src/adaptation/icap/Elements.h @@ -64,6 +64,7 @@ using Adaptation::vectPointStr; typedef const char *XactOutcome; ///< transaction result for logging extern const XactOutcome xoUnknown; ///< initial value: outcome was not set +extern const XactOutcome xoGone; ///< initiator gone, will not continue extern const XactOutcome xoRace; ///< ICAP server closed pconn when we started extern const XactOutcome xoError; ///< all kinds of transaction errors extern const XactOutcome xoOpt; ///< OPTION transaction diff --git a/src/adaptation/icap/Xaction.cc b/src/adaptation/icap/Xaction.cc index 883d4c2fb9..58d9f9d777 100644 --- a/src/adaptation/icap/Xaction.cc +++ b/src/adaptation/icap/Xaction.cc @@ -476,8 +476,10 @@ void Adaptation::Icap::Xaction::noteInitiatorAborted() { if (theInitiator.set()) { + debugs(93,4, HERE << "Initiator gone before ICAP transaction ended"); clearInitiator(); detailError(ERR_DETAIL_ICAP_INIT_GONE); + setOutcome(xoGone); mustStop("initiator aborted"); } -- 2.47.3