From: wessels <> Date: Wed, 13 Aug 2003 06:39:12 +0000 (+0000) Subject: Bug #736: ICP dynamic timeout algorithm ignores multicast X-Git-Tag: SQUID_3_0_PRE3~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1bf2cd4981593ef82aa7d7bb4010eb73e5b53400;p=thirdparty%2Fsquid.git Bug #736: ICP dynamic timeout algorithm ignores multicast The algorithm that calculates the timeout for a set of ICP queries ignores multicast neighbors. It also ignores the expected number of replies because "*exprep" is always set equal to parent_exprep + sibling_exprep. This patch adds multicast group counts to the expected number of ICP replies. It also sets the query timeout to the multicast peer rtt (x2) if there were no parents query. If there are parents, the expected parents timeout is used. --- diff --git a/doc/release-notes/release-3.0.sgml b/doc/release-notes/release-3.0.sgml index 9e92449eb4..6fc71edea3 100644 --- a/doc/release-notes/release-3.0.sgml +++ b/doc/release-notes/release-3.0.sgml @@ -2,7 +2,7 @@
Squid 3.0 release notes Squid Developers -$Id: release-3.0.sgml,v 1.12 2003/08/05 08:52:36 hno Exp $ +$Id: release-3.0.sgml,v 1.13 2003/08/13 00:39:12 wessels Exp $ This document contains the release notes for version 3.0 of Squid. @@ -127,6 +127,7 @@ This fixes two issues:Transparently intercepted requests is no lo Requests denied due to 'http_reply_access' are now logged with TCP_DENIED_REPLY. Added counters for HTCP messages sent and received, reported in 'info' cache manager page. + Fixed 'ICP dynamic timeout algorithm ignores multicast' bug Changes to squid.conf diff --git a/src/neighbors.cc b/src/neighbors.cc index d971a6a0c0..c3048542b0 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.321 2003/08/10 11:00:43 robertc Exp $ + * $Id: neighbors.cc,v 1.322 2003/08/13 00:39:16 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -593,6 +593,7 @@ neighborsUdpPing(HttpRequest * request, int peers_pinged = 0; int parent_timeout = 0, parent_exprep = 0; int sibling_timeout = 0, sibling_exprep = 0; + int mcast_timeout = 0, mcast_exprep = 0; if (Config.peers == NULL) return 0; @@ -673,7 +674,8 @@ neighborsUdpPing(HttpRequest * request, * says a multicast peer is dead. */ p->stats.last_reply = squid_curtime; - (*exprep) += p->mcast.n_replies_expected; + mcast_exprep += p->mcast.n_replies_expected; + mcast_timeout += (p->stats.rtt * p->mcast.n_replies_expected); } else if (neighborUp(p)) { /* its alive, expect a reply from it */ @@ -742,7 +744,7 @@ neighborsUdpPing(HttpRequest * request, /* * How many replies to expect? */ - *exprep = parent_exprep + sibling_exprep; + *exprep = parent_exprep + sibling_exprep + mcast_exprep; /* * If there is a configured timeout, use it @@ -753,6 +755,8 @@ neighborsUdpPing(HttpRequest * request, if (*exprep > 0) { if (parent_exprep) *timeout = 2 * parent_timeout / parent_exprep; + else if (mcast_exprep) + *timeout = 2 * mcast_timeout / mcast_exprep; else *timeout = 2 * sibling_timeout / sibling_exprep; } else