Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2007 10:59:07 -0700 (PDT)
From:      Nick Johnson <freebsd@spatula.net>
To:        java@freebsd.org
Subject:   1.5 ignoring networkaddress.cache property?
Message-ID:  <20070822104335.L82369@turing>

next in thread | raw e-mail | index | archive | help
I've noticed that 1.5 seems to be ignoring the value set for 
networkaddress.cache.negative.ttl in 
$JAVA_HOME/jre/lib/security/java.policy when a DNS request times out.

In one of my forms I validate user-provided URLs by trying to fetch them 
and ensuring I get a reasonable response (e.g., not 404, 403, 500, etc).

If the DNS request for the hostname in the URL times out once, the JRE 
never tries a lookup again.  I've verified that it isn't asking by 
snooping DNS traffic on my loopback with tcpdump.

Positive lookups do cache properly.  Negative lookups that *don't* time 
out (ie, they get an NXDOMAIN response) also seem to obey the 
networkaddress.cache.negative.ttl property.

So the behaviour seems to be that a DNS timeout is cached forever, whereas 
postive or negative responses are cached according to 
networkaddress.cache.*.

   Nick

-- 
"Courage isn't just a matter of not being frightened, you know. It's being
 afraid and doing what you have to do anyway."
   Doctor Who - Planet of the Daleks
This message has been brought to you by Nick Johnson 2.3b1 and the number 6.
http://healerNick.com/       http://morons.org/        http://spatula.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070822104335.L82369>