JDK 8 RFR 8010371: getaddrinfo can fail with EAI_SYSTEM/EAGAIN, causes UnknownHostException to be thrown

Chris Hegarty chris.hegarty at oracle.com
Wed Oct 2 14:40:44 UTC 2013


On 02/10/2013 04:44, Alan Bateman wrote:
> On 01/10/2013 12:46, Brian Burkhalter wrote:
>> :
>>
>> I updated the webrev
>>
>> http://cr.openjdk.java.net/~bpb/8010371/
>>
>> with changes in the test of the return value of getaddrinfo for Unix
>> Inet 4 and 6 and Windows Inet 6. The usual testing is in progress.
>>
>> Brian
> This looks better, although I think I would reverse re-write the
> expressions to "if (error = ...)".
>
> One thing to consider is whether this condition is really worth
> introducing HostLookupException, particularly when it doesn't include

I am also not convinced of the merits of adding a new public checked 
Exception type for this situation. Do we expect all callers of API's 
that can throw UKE to now have to catch this Exception and provide their 
own try logic? Otherwise, what do we expect them to do with it.

I cannot see the original webrev, so cannot comment on the retry logic 
that was there. Do you still have it around? Can upload as a .05 
version? The reason I ask is that, IMHO, I would prefer this type of 
approach over the new Exception type, but that could be just me.

Thanks,
-Chris.



> additional information (except to distinguish it from its supertype). If
> a new exception is really needed then maybe it could add the error
> message obtained from gai_strerror, alternatively maybe you could
> considered setting the cause of the UHE to something like an IOException
> with the translation of the error.
>
> -Alan.



More information about the core-libs-dev mailing list