Author: markt Date: Tue Feb 2 11:54:33 2016 New Revision: 1728091 URL: http://svn.apache.org/viewvc?rev=1728091&view=rev Log: Fix a timing issue which is one cause of intermittent unit test failures for WebSocket.
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1728091&r1=1728090&r2=1728091&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Tue Feb 2 11:54:33 2016 @@ -660,6 +660,10 @@ public class WsSession implements Sessio // needs to be set here. if (state == State.OPEN) { futures.put(f2sh, f2sh); + } else if (f2sh.isDone()) { + // NO-OP. The future completed before the session closed to no + // need to register in case the session closes before it + // completes. } else { // Construct the exception outside of the sync block fail = true; Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1728091&r1=1728090&r2=1728091&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue Feb 2 11:54:33 2016 @@ -45,6 +45,13 @@ issues do not "pop up" wrt. others). --> <section name="Tomcat 9.0.0.M4" rtext="In development"> + <subsection name="WebSocket"> + <fix> + Fix a timing issue on session close that could result in an exception + being thrown for an incomplete message even through the message was + completed. (markt) + </fix> + </subsection> </section> <section name="Tomcat 9.0.0.M3" rtext="Voting in progress"> <subsection name="General"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org