Hello
I need some help with some of the code for neighbors. As background, I am
working on some code to provide CARP parent support to MS proxy 2.0. I'm
working with squid 2.2STABLE3. I need to know which peers are up and which
peers are down. MS proxy expects a table that has a list of hosts with
some information including whether they are up or down. If a parent is
marked as up and really isn't, MS proxy times out before it goes direct.
The timeout is on the order of 30 seconds.
My problem with squid is that just because neighborUp says a host is up,
doesn't mean that it really is. In general, a peer is marked down when it
has been more than Config.deadPeer seconds between the last_query and
last_reply. However, as I understand it, some code was added because
people were complaining that ICP was broken when they tried the very first
request to a host? Anyways, code was added in two places. The first in
neighborsUdpPing: if there have been no requests for more than
Config.deadPeer seconds then a host that would be marked down is given a
fake last_reply time. The second is in neighborUp where a host is counted
as up if there have been no requests for more than Config.deadPeer
seconds.
Everything works fine for me as long as there is a request every
Config.deadPeer seconds (default 10 seconds). The problem is that MS Proxy
behaves so badly if it's told a down host is up.
I think that the code in neighobrsUdpPing (line 441 of neighbors.c)
doesn't need to be there because of the code in neighborUp. I tried this
and it seems to work; when a host is down but there hasn't been a request
in Config.deadParent seconds it is considered up. However, I might not
understand the original problem.
If the code in neighborsUdpPing is gone, then in my own code I can check
both what neighborUp returns and check if last_query - last_reply >
Config.deadPeer. This isn't ideal, I wish that neighborUp would tell me
the truth, but it does work.
thanks
Justin
Received on Tue Jul 29 2003 - 13:15:58 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:09 MST