Bug 59908 - Tomcat reports empty(null) close reason if send operation timed out.
Summary: Tomcat reports empty(null) close reason if send operation timed out.
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: 8.0.x-trunk
Hardware: PC Linux
: P2 minor (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-28 09:47 UTC by Pavel
Modified: 2016-08-10 22:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
versions:
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