-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b127
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8331262 | 8u431 | Prasadarao Koppula | P4 | Resolved | Fixed | b01 |
Test: sun/security/tools/keytool/printssl.sh
Log:
Exception in thread "Thread-0" Exception in thread "main" java.net.SocketException: Socket closed
at java.net.PlainSocketImpl.socketAccept(java.base@9-ea/Native Method)
at java.net.AbstractPlainSocketImpl.accept(java.base@9-ea/AbstractPlainSocketImpl.java:459)
at java.net.ServerSocket.implAccept(java.base@9-ea/ServerSocket.java:546)
at sun.security.ssl.SSLServerSocketImpl.accept(java.base@9-ea/SSLServerSocketImpl.java:352)
at PrintSSL.main(PrintSSL.java:54)
java.lang.RuntimeException: Timeout
at PrintSSL$1.run(PrintSSL.java:49)
.............
result: Error. Program `sh' timed out (timeout set to 960000ms, elapsed time was 960002ms).
test result: Error. Program `sh' timed out (timeout set to 960000ms, elapsed time was 960002ms).
The test manage closing ServerSocket by another thread holding it for 30 second.
Here it looks like the socket closed in between accept() called.
To avoid such issue it can be implemented in a different way which can use socket.setSoTimeout() with try resource clause.
Log:
Exception in thread "Thread-0" Exception in thread "main" java.net.SocketException: Socket closed
at java.net.PlainSocketImpl.socketAccept(java.base@9-ea/Native Method)
at java.net.AbstractPlainSocketImpl.accept(java.base@9-ea/AbstractPlainSocketImpl.java:459)
at java.net.ServerSocket.implAccept(java.base@9-ea/ServerSocket.java:546)
at sun.security.ssl.SSLServerSocketImpl.accept(java.base@9-ea/SSLServerSocketImpl.java:352)
at PrintSSL.main(PrintSSL.java:54)
java.lang.RuntimeException: Timeout
at PrintSSL$1.run(PrintSSL.java:49)
.............
result: Error. Program `sh' timed out (timeout set to 960000ms, elapsed time was 960002ms).
test result: Error. Program `sh' timed out (timeout set to 960000ms, elapsed time was 960002ms).
The test manage closing ServerSocket by another thread holding it for 30 second.
Here it looks like the socket closed in between accept() called.
To avoid such issue it can be implemented in a different way which can use socket.setSoTimeout() with try resource clause.
- backported by
-
JDK-8331262 sun/security/tools/keytool/printssl.sh failed with "Socket closed"
-
- Resolved
-