RFR [13] 8229018: Switching to an infinite socket timeout on Windows leads to high CPU load

Alan Bateman Alan.Bateman at oracle.com
Sun Aug 4 19:07:07 UTC 2019


On 02/08/2019 09:39, Michael McMahon wrote:
> Could we get the following change (from Alan Bateman) reviewed please?
>
> http://cr.openjdk.java.net/~michaelm/8229018/webrev.1/index.html
>
> It is a long standing issue but was only uncovered after switching the 
> classic
> networking socket impl to use NIO in JDK 13. The bug is seen when 
> setting a finite timeout
> on a socket and then switching back to block forever, which results in 
> a busy loop.
>
> There is no regression test as it is difficult to test this kind of 
> issue which
> only results in CPU overhead.
Thanks for the taking this one. The Net.poll method wasn't previously 
used to block indefinitely so this wasn't noticed before. As you say, 
this is impossible to test as it isn't a correctness issue. Ditto for 
the untimed accept after a timed accept case where the same busy loop 
will happen.

-Alan


More information about the nio-dev mailing list