Re: Occasional spurious ERR_DNS FAIL?

From: Duane Wessels <[email protected]>
Date: Mon, 23 Jun 97 10:55:14 -0700

JLarmour@origin-at.co.uk writes:

>Some more info - I think I've found the problem. Here is an extract from
>cache.log with debugging set to "ALL,1 4,1 14,9". The entries of interest
>involve www.fastcompany.com, although there are other requests going on at
>the same time.
>
>Firstly, it shows the name being retrieved from the ipcache correctly. Then
>note that it is released. Then it gets another request, followed by the
>ERR_DNS_FAIL. Note the ipcache doesn't even try to use a dnsserver. Then
>later on, we get another request which generates the correct response, i.e.
>a MISS followed by a request to a dnsserver.
>
>So I suspect there is something in the ipcache code which fails if a record
>is released at just the wrong time. I think this is the limit to my
>squid-hacking ability right now, so over to someone else!

Jonathan,

Thanks for the great debugging. I think this little patch below
will prevent this situation from happening:

Index: src/ipcache.c
===================================================================
RCS file: /surf1/CVS/squid/src/ipcache.c,v
retrieving revision 1.106.2.19
diff -w -u -r1.106.2.19 ipcache.c
--- ipcache.c 1997/06/19 18:07:31 1.106.2.19
+++ ipcache.c 1997/06/23 17:54:49
@@ -318,6 +318,9 @@
        return 0;
     if (i->expires > squid_curtime)
        return 0;
+ if (i->status == IP_CACHED)
+ if (squid_curtime - i->lastref < 60)
+ return 0;
     return 1;
 }

As your debugging shows, IP cache entries which were very recently used
could still be purged. This fix is not exactly the right thing to do,
but its a pretty simple hack.

Duane W.
Received on Mon Jun 23 1997 - 11:07:30 MDT

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