RFR[8246132]: 'AsynchronousSocketChannelNAPITest failing with a NotYetConnectedException'

Patrick Concannon patrick.concannon at oracle.com
Fri Jun 5 11:36:38 UTC 2020


Hi Alan,

That’s much more concise. Thanks for the tip!

I’ve incorporated it into the updated webrev below.

http://cr.openjdk.java.net/~pconcannon/8246132/webrevs/webrev.01/ <http://cr.openjdk.java.net/~pconcannon/8246132/webrevs/webrev.01/>

Kind regards,
Patrick

> On 5 Jun 2020, at 06:33, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> 
> 
> On 04/06/2020 22:08, Daniel Fuchs wrote:
>> 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.
> Might be simpler to just change it to c.connect(remote).get(); to that it blocks until the connect is established (or it fails), no need to use the 3-arg connect method here.
> 
> -Alan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20200605/70ee41df/attachment.htm>


More information about the net-dev mailing list