Author: markt Date: Tue Feb 24 21:04:31 2015 New Revision: 1662117 URL: http://svn.apache.org/r1662117 Log: Fix a crash with testUpgrade and APR native. There was a small gap between the point where the write thread exited the poller and the connections map was queried for the wrapper that the read thread could close the socket and the write thread would have no visibility of the change. I suspect the converse was also true. This closes the gap.
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1662117&r1=1662116&r2=1662117&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue Feb 24 21:04:31 2015 @@ -2341,7 +2341,7 @@ public class AprEndpoint extends Abstrac private void doRun() { // Process the request from this socket - if (socket.getSocket() == null) { + if (socket.getSocket() == null || !connections.containsKey(socket)) { // Closed in another thread return; } Modified: tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java?rev=1662117&r1=1662116&r2=1662117&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java (original) +++ tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java Tue Feb 24 21:04:31 2015 @@ -170,7 +170,7 @@ public class TestUpgrade extends TomcatB Socket socket = SocketFactory.getDefault().createSocket("localhost", getPort()); - socket.setSoTimeout(5000); + socket.setSoTimeout(500000); UpgradeConnection uc = new UpgradeConnection(socket); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org