From owner-freebsd-java@FreeBSD.ORG Wed Aug 22 17:59:10 2007 Return-Path: Delivered-To: java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B0A916A41A for ; Wed, 22 Aug 2007 17:59:10 +0000 (UTC) (envelope-from freebsd@spatula.net) Received: from turing.morons.org (turing.morons.org [208.96.51.42]) by mx1.freebsd.org (Postfix) with ESMTP id 48BD113C465 for ; Wed, 22 Aug 2007 17:59:10 +0000 (UTC) (envelope-from freebsd@spatula.net) Received: by turing.morons.org (Postfix, from userid 1001) id 0E79517030; Wed, 22 Aug 2007 10:59:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by turing.morons.org (Postfix) with ESMTP id 0B5E31702C for ; Wed, 22 Aug 2007 10:59:08 -0700 (PDT) Date: Wed, 22 Aug 2007 10:59:07 -0700 (PDT) From: Nick Johnson X-X-Sender: spatula@turing To: java@freebsd.org Message-ID: <20070822104335.L82369@turing> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Subject: 1.5 ignoring networkaddress.cache property? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2007 17:59:10 -0000 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/