RFR: 8146213, 8133093: java/nio/channels/ServerSocketChannel/AdaptServerSocket.java failed intermittently with Connection refused and Accept did not time out
Hamlin Li
huaming.li at oracle.com
Fri Jan 15 08:34:22 UTC 2016
On 2016/1/15 15:44, Alan Bateman wrote:
>
>
> On 14/01/2016 23:02, Brian Burkhalter wrote:
>> Hi Hamlin,
>>
>> On Jan 13, 2016, at 7:32 PM, Hamlin Li <huaming.li at oracle.com> wrote:
>>
>>> Would you please help to review the fix for below bugs?
>>> https://bugs.openjdk.java.net/browse/JDK-8146213, Test
>>> java/nio/channels/ServerSocketChannel/AdaptServerSocket.java failed
>>> intermittently with Connection refused,
>>> andhttps://bugs.openjdk.java.net/browse/JDK-8133093, Test
>>> java/nio/channels/ServerSocketChannel/AdaptServerSocket.java failed
>>> with Accept did not time out.
>>>
>>> webrev :http://cr.openjdk.java.net/~mli/8146213/webrev.00/
>>
>> This looks OK to me aside from the following two points:
>>
> Hamlin - would it be possible to summarize what the issue this? This
> is a very old test and would be good to have this information to
> understand what the issue is?
Hi Alan,
Thanks for reviewing, please check new webrev :
http://cr.openjdk.java.net/~mli/8146213/webrev.02/.
both bug JDK-8146213 and JDK-8133093 are test bugs due to race condition.
* The bugs occurs only when testing accept timeout in server side,
* it's due to race conditions. There is some time window between
* server.accept timeout(in server thread), client.interrupt(in
server thread),
* client wakeup from sleeping(in client thread),
client.connect(in client thread).
* 1. if time order is server.accept timeout -> client.interrupt
* -> client wakeup from sleeping, then test pass successfully.
* 2. if time order is server.accept timeout -> client wakes up
from sleeping
* -> client.connect -> client interrupt, then
* exception(java.net.ConnectException: Connection refused:
connect) occurs,
* it's bug JDK-8146213.
* 3. if time order is client wakeup from sleeping -> client.connect
* -> server.accept timeout,
* then exception(java.lang.Exception: Accept did not time out)
occurs,
* it's bug JDK-8133093.
* To fix the bugs 8146213 8133093, we only need not to start
client when testing
* server accept timeout.
>
> Also just to say that it's best to keep the coding style consistent
> when you can.
fixed.
Thank you
-Hamlin
>
> -Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20160115/f517214d/attachment-0001.html>
More information about the nio-dev
mailing list