From 8d74a3115fe35b71f8e7528d28ab7b6161afab5f Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 1 Aug 2012 19:55:18 +1200 Subject: [PATCH] Skip Failure Ratio calculations entirely when ICP is disabled. Also, mention ICP in the logged error message. unqualified 'HIT' confuses people (self included) more familiar with the HTTP type of HIT responses. --- src/client_side_request.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client_side_request.cc b/src/client_side_request.cc index c41e5427da..1c983f6844 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -230,13 +230,17 @@ checkFailureRatio(err_type etype, hier_code hcode) #define FAILURE_MODE_TIME 300 #endif + if (hcode == HIER_NONE) + return; + + // don't bother when ICP is disabled. + if (Config.Port.icp <= 0) + return; + static double magic_factor = 100.0; double n_good; double n_bad; - if (hcode == HIER_NONE) - return; - n_good = magic_factor / (1.0 + request_failure_ratio); n_bad = magic_factor - n_good; @@ -267,7 +271,7 @@ checkFailureRatio(err_type etype, hier_code hcode) debugs(33, DBG_CRITICAL, "WARNING: Failure Ratio at "<< std::setw(4)<< std::setprecision(3) << request_failure_ratio); - debugs(33, DBG_CRITICAL, "WARNING: Going into hit-only-mode for " << + debugs(33, DBG_CRITICAL, "WARNING: ICP going into HIT-only mode for " << FAILURE_MODE_TIME / 60 << " minutes..."); hit_only_mode_until = squid_curtime + FAILURE_MODE_TIME; -- 2.47.2