RFR 8075484:SocketInputStream.socketRead0 can hang even with soTimeout set

Vyom Tewari vyom.tewari at oracle.com
Mon Aug 22 11:42:04 UTC 2016


Hi All,

Please review the code changes for below issue.

Bug         : https://bugs.openjdk.java.net/browse/JDK-8075484

webrev    : 
http://cr.openjdk.java.net/~vtewari/8075484/webrev0.0/index.html 
<http://cr.openjdk.java.net/%7Evtewari/8075484/webrev0.0/index.html>

This issue is SocketInputStream.socketread0() hangs even with 
"soTimeout" set.the implementation of 
Java_java_net_SocketInputStream_socketRead0 assumes that read() won't 
block after poll() reports that a read is possible.

This assumption does not hold, as noted on the man page for select 
(referenced by the man page for poll): Under Linux, select() may report 
a socket file descriptor as "ready for reading", while nevertheless a 
subsequent read blocks. This could for example happen when data has 
arrived but upon examination has wrong checksum and is discarded.

Thanks,

Vyom




More information about the net-dev mailing list