Project: Tomcat
Bug 53074 [websocket] java.net.SocketTimeoutException: Read timed caused by server.xml' connectTimeout
Reported: 2012-04-13 13:45:11 | Status: resolved fixed

The default connectTimeout value is set to 20000 and cause issue with WebSocket connection java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at org.apache.coyote.http11.upgrade.UpgradeBioProcessor.read(UpgradeBioProcessor.java:75) at org.apache.catalina.websocket.WsFrame.nextFrame(WsFrame.java:213) at org.apache.catalina.websocket.WsInputStream.nextFrame(WsInputStream.java:68) at org.apache.catalina.websocket.StreamInbound.onData(StreamInbound.java:143) at org.apache.coyote.http11.upgrade.UpgradeProcessor.upgradeDispatch(UpgradeProcessor.java:83) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:563) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Increasing the value delay the issue (but the timeout should not occurs)

Files changed in fix:
java/org/apache/catalina/websocket/StreamInbound.java java/org/apache/coyote/ajp/AjpAprProtocol.java java/org/apache/coyote/http11/Http11AprProtocol.java java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java java/org/apache/coyote/http11/upgrade/UpgradeInbound.java java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java java/org/apache/tomcat/util/net/AprEndpoint.java