On Wed, 9 Dec 2020 17:23:19 GMT, Chris Hegarty <che...@openjdk.org> wrote:

>> Hi, 
>> 
>> Please find here a changeset that fixes the infrequent (but annoying) test 
>> failures
>> caused by unexpected ConnectionException "Connection timed out: no further 
>> information"
>> which have been observed to occur on some platforms.
>> 
>> Tests are updated to allow the test server to handle requests concurrently.
>> PlainHttpConnection is updated to retry connection once if 
>> chan::finishConnect fails
>> early with ConnectionException and the connection timeout has not expired.
>
> src/java.net.http/share/classes/jdk/internal/net/http/PlainHttpConnection.java
>  line 205:
> 
>> 203:         }
>> 204:         return cf.handle((r,t) -> checkRetryConnect(r, t,exchange))
>> 205:                 .thenCompose(Function.identity());
> 
> So this changes behaviour so that a single subsequent additional TCP 
> connection may be tried for all cases where the connection fails AND there is 
> remaining connection deadline. Ok.

Yes - I didn't want to depend on the exception message - and there's no way to 
distinguish with the exception type (it's raw `ConnectionException`). It will 
however happen *only* when the `ConnectionException` is thrown by 
`SocketChannel::finishConnect`.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1716

Reply via email to