harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <ndbe...@apache.org>
Subject Re: [classlib][luni] put only host name in UnknownHostException
Date Fri, 25 Apr 2008 03:10:21 GMT
It looks like the negative cache implementation isn't thread safe, so I'm
going to fix that as well.

-Nathan

On Thu, Apr 24, 2008 at 9:08 AM, Nathan Beyer <ndbeyer@apache.org> wrote:

>
>
> On Thu, Apr 24, 2008 at 3:59 AM, Tim Ellison <t.p.ellison@gmail.com<https://mail.google.com/mail?view=cm&tf=0&to=t.p.ellison@gmail.com>>
> wrote:
>
>> 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.
>
>
> Ahh, yes, indeed. The code's a bit weird, but I see it now. I'll rework it
> a bit by removing the storage of the failed message.
>
> -Nathan
>
>>
>>
>> [1] http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html
>>
>> Regards,
>> Tim
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message