Bug 59908

Summary: Tomcat reports empty(null) close reason if send operation timed out.
Product: Tomcat 8 Reporter: Pavel <p.a.baranchikov>
Component: WebSocketAssignee: Tomcat Developers Mailing List <dev>
Severity: minor    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: Linux   

Description Pavel 2016-07-28 09:47:34 UTC
If Tomcat tryes to send large enough message thought websoket (I've tested binary messages) not to fit into 20 sec timeout, session is closed with null reason.

"null" reason goes from org.apache.tomcat.websocket.FutureToSendHandler.get(long, TimeUnit) method, which throws "TimeoutException" constructed with default constructor.

Later, in org.apache.tomcat.websocket.WsRemoteEndpointImplBase.handleSendFailureWithEncode(Throwable) CloseReason object is created, calling t.getMessage(), which returns null.

The expected behaviour is not to report null close reason, but instead report, that operation timed out.
Comment 1 Mark Thomas 2016-08-10 22:55:18 UTC
Thanks for the report. This has been fixed in the following
9.0.x for 9.0.0.M10 onwards
8.5.x for 8.5.5 onwards
8.0.x for 8.0.37 onwards
7.0.x for 7.0.71 onwards