Bug 59119 - Improper forced reading causing client read timeout
Summary: Improper forced reading causing client read timeout
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: 8.0.x-trunk
Hardware: All All
: P2 major (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2016-03-04 19:38 UTC by Jack
Modified: 2016-03-07 12:33 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Jack 2016-03-04 19:38:12 UTC
In source code [1], the "forceRead" section (from Line 265 to 273, as of today) does not reset "forceRead" to false after a forced read. This causes improper forced reading in follow-up loops even though there are still data in the socketChannel left over from last unwrap. As a result, it causes timeout in the WsWebSocketContainer.processResponse() method, and prevents websocket hand-shaking from completion.

[1] http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java
Comment 1 Jack 2016-03-04 19:41:02 UTC
Note the same issue applies to other versions as well.
Comment 2 Mark Thomas 2016-03-07 12:33:52 UTC
Thanks for the report.

This has been fixed in 9.0.x for 9.0.0.M4 onwards, 8.0.x for 8.0.33 onwards and 7.0.x for 7.0.69 onwards.