RFR[8246132]: 'AsynchronousSocketChannelNAPITest failing with a NotYetConnectedException'
Daniel Fuchs
daniel.fuchs at oracle.com
Thu Jun 4 21:08:56 UTC 2020
Hi Patrick,
Looks good, but for one thing.
Throwing in the failed() callback will probably accomplish
nothing since that is likely be called asynchronously in some
background thread. So if the connect doesn't succeed immediately
but fail instead at a later time, the test will block forever
waiting on the CountDownLatch until it gets interrupted by
the jtreg timeout.
Instead of using a CountDownLatch, I'd suggest using a
CompletableFuture<Boolean> which will allow to rethrow
the exception from the main thread.
best regards,
-- daniel
On 04/06/2020 17:55, Patrick Concannon wrote:
> Hi,
>
> Could someone please review my patch for JDK-8246132 -
> *'AsynchronousSocketChannelNAPITest failing with a
> NotYetConnectedException'* ?
>
> AsynchronousSocketChannelNAPITest sometimes fails with a
> NotYetConnectedException while trying to read data after connecting.
> This is fix changes the connect method to use a CompletionHandler to
> wait for the connection to be made before reading.
>
> issue: https://bugs.openjdk.java.net/browse/JDK-8246132
> webrev: http://cr.openjdk.java.net/~pconcannon/8246132/webrevs/webrev.00/
>
>
> Kind regards,
> Patrick
More information about the net-dev
mailing list