This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 5d5fcb1247 Fix likely cause of some intermittent test failures 5d5fcb1247 is described below commit 5d5fcb1247ee9131033582383d721ce360a2b7f0 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Apr 26 08:38:08 2023 +0100 Fix likely cause of some intermittent test failures --- java/org/apache/tomcat/websocket/WsSession.java | 14 ++++++++------ webapps/docs/changelog.xml | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/java/org/apache/tomcat/websocket/WsSession.java b/java/org/apache/tomcat/websocket/WsSession.java index 18d7704f39..d8dfb15e9c 100644 --- a/java/org/apache/tomcat/websocket/WsSession.java +++ b/java/org/apache/tomcat/websocket/WsSession.java @@ -660,9 +660,10 @@ public class WsSession implements Session { // Flush any batched messages not yet sent. try { wsRemoteEndpoint.setBatchingAllowed(false); - } catch (IOException e) { - log.warn(sm.getString("wsSession.flushFailOnClose"), e); - fireEndpointOnError(e); + } catch (Throwable t) { + ExceptionUtils.handleThrowable(t); + log.warn(sm.getString("wsSession.flushFailOnClose"), t); + fireEndpointOnError(t); } // Send the close message to the remote endpoint. @@ -700,9 +701,10 @@ public class WsSession implements Session { // Flush any batched messages not yet sent. try { wsRemoteEndpoint.setBatchingAllowed(false); - } catch (IOException e) { - log.warn(sm.getString("wsSession.flushFailOnClose"), e); - fireEndpointOnError(e); + } catch (Throwable t) { + ExceptionUtils.handleThrowable(t); + log.warn(sm.getString("wsSession.flushFailOnClose"), t); + fireEndpointOnError(t); } // Send the close message response to the remote endpoint. diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index c9f7fa6ada..1b8bb1122a 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -132,6 +132,10 @@ <bug>66575</bug>: Avoid unchecked use of the backing array of a buffer provided by the user in the compression transformation. (remm) </fix> + <fix> + Improve exception handling when flushing batched messages during + WebSocket session close. (markt) + </fix> </changelog> </subsection> </section> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org