]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #736: ICP dynamic timeout algorithm ignores multicast
authorwessels <>
Wed, 13 Aug 2003 06:39:12 +0000 (06:39 +0000)
committerwessels <>
Wed, 13 Aug 2003 06:39:12 +0000 (06:39 +0000)
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.

doc/release-notes/release-3.0.sgml
src/neighbors.cc

index 9e92449eb4ff334b9d5de6d381ff85269db9e33f..6fc71edea3cdf1c5a8060dec2bb48d90b1f6229a 100644 (file)
@@ -2,7 +2,7 @@
 <article>
 <title>Squid 3.0 release notes</title>
 <author>Squid Developers</author>
-<date>$Id: release-3.0.sgml,v 1.12 2003/08/05 08:52:36 hno Exp $</date>
+<date>$Id: release-3.0.sgml,v 1.13 2003/08/13 00:39:12 wessels Exp $</date>
 
 <abstract>
 This document contains the release notes for version 3.0 of Squid.
@@ -127,6 +127,7 @@ This fixes two issues:<itemize><item>Transparently intercepted requests is no lo
  <item>Requests denied due to 'http_reply_access' are now logged with TCP_DENIED_REPLY.
  <item>Added counters for HTCP messages sent and received, reported
        in 'info' cache manager page.
+ <item>Fixed 'ICP dynamic timeout algorithm ignores multicast' bug
 </itemize>
 
 <sect>Changes to squid.conf
index d971a6a0c065862a64bef50c3c99b664bddd4b38..c3048542b08c705cde940fb766f950690968dcc7 100644 (file)
@@ -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