Re: dead parent never revives

From: Richard Huveneers <richard@dont-contact.us>
Date: 8 Sep 1996 12:33:01 GMT

In article <50u8ms$n7@zeus.hekkihek.hacom.nl>, richard@hekkihek.hacom.nl (Richard Huveneers) writes:
>This is with Squid 1.1alpha17 with patch 01 and 02 applied.
>
>When our parent is detected to be DEAD, it never revives. This happened last night
>(after upgrading to 1.1alpha17). I just tried it manually by blocking the UDP
>traffic to our parent, and it seems reproducible.
>
>I'm now trying to track this bug down, but I don't count on it that I will
>be able to find it.

Yes! I found the bug. When a parent dies, the mem->e_pings_n_pings counter
is not incremented (neighbors.c:491). As a result, neighborsUdpPing()
returns 0 (we have only one parent). But then the ping_status will remain
PING_NONE instead of PING_WAITING (proto.c:232), and all ICP replies
will be ignored (icp.c:1116), so the parent will remain dead forever...

I applied the following patch, of which I'm not sure whether it's the
right way to go, but it works for me. It just increments the mem->e_pings_n_pings
for dead parents too. I think this is correct, but I'm not sure.

Anyway, here's the patch:

*** neighbors.c.orig Sat Aug 31 00:44:09 1996
--- neighbors.c Sun Sep 8 14:11:59 1996
***************
*** 479,484 ****
--- 479,485 ----
  
          e->stats.ack_deficit++;
          e->stats.pings_sent++;
+ mem->e_pings_n_pings++;
  
          debug(15, 3, "neighborsUdpPing: %s: ack_deficit = %d\n",
              e->host, e->stats.ack_deficit);
***************
*** 486,492 ****
          if (e->stats.ack_deficit < HIER_MAX_DEFICIT) {
              /* its alive, expect a reply from it */
              e->neighbor_up = 1;
- mem->e_pings_n_pings++;
          } else {
              /* Neighbor is dead; ping it anyway, but don't expect a reply */
              e->neighbor_up = 0;
--- 487,492 ----

Regards, Richard.
Received on Sun Sep 08 1996 - 05:53:44 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:32:56 MST