JEP-353 - Socket.connect now throws NoRouteToHostException as against ConnectException previously
Alan Bateman
Alan.Bateman at oracle.com
Tue Aug 24 06:47:37 UTC 2021
On 24/08/2021 04:09, Jaikiran Pai wrote:
>
>>
>>> Do you connections to the Apache HTTP client library and the retry
>>> code that is looking for specific exceptions? From a distance it
>>> seems very fragile and depending on very implementation specific
>>> behavior. I wonder if it has ever been tested on Windows or with an
>>> untimed connect.
>>
>> I am not involved in the Apache HTTP client library project. However,
>> I will go ahead and open a discussion in their mailing list and bring
>> this issue to their attention, so that they can decide how to deal
>> with it.
>>
>> Thank you for your help and the explanation.
>
> This has now been fixed in the Apache HTTP client library to no longer
> treat these two exception types differently when it comes to retry
> handling logic
Good. Note that BindException is possible when attempt to establish a
connection because the kernel will bind the socket to a local port if
not explicitly bound already. It might arise when there are no ports
available. I don't know if this changes the retry logic in the HTTP
client but thought I should mention it.
-Alan
More information about the net-dev
mailing list