Nathan Beyer wrote:
https://issues.apache.org/jira/browse/HARMONY-5784

Anyone have any issue with making this change? Currently, the behavior is
such that the host is in the message, but with the additional "No such file
or directory" message. There doesn't seem to be much value in the additional
message, so changing this to just be the host that was passed in is pretty
trivial.

Yeah, can dump the bogus information from the message.

However, when unwinding this a bit, there's this NegativeCache class that
stores failed lookups and the message failure. Is this really needed? Is it
appropriate? There's already a cache of resolved InetAddress object that
were found, but this cache has a expiry, as I would have expected, but the
NegativeCache doesn't. Any thoughts or comments on eliminating this negative
cache bit? It seems like the negative cache isn't being maintained properly
(no expiry, etc), so if a host became accessible over time, it wouldn't be
accessible. Additionally, I don't think the overhead of the memory, though
minimal, is really worth not executing a lookup, which would already be
offset by resolvable hosts in the other cache.

The negative cache is needed, and it is described by the spec for InetAddress [1] (see "InetAddress Caching").

It should have an expiry mechanism which admins can tweak using the networkaddress.cache.negative.ttl property.

[1] http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html

Regards,
Tim

Reply via email to