Author: markt Date: Fri Dec 2 09:09:46 2016 New Revision: 1772319 URL: http://svn.apache.org/viewvc?rev=1772319&view=rev Log: Reduce the window in which an async request that has just started processing on a container thread remains eligible for an async timeout.
Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1772319&r1=1772318&r2=1772319&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Fri Dec 2 09:09:46 2016 @@ -678,8 +678,10 @@ public abstract class AbstractProtocol<S S socket = wrapper.getSocket(); Processor processor = connections.get(socket); - if ((status == SocketEvent.DISCONNECT || status == SocketEvent.ERROR) - && processor == null) { + if (processor != null) { + // Make sure an async timeout doesn't fire + getProtocol().removeWaitingProcessor(processor); + } else if (status == SocketEvent.DISCONNECT || status == SocketEvent.ERROR) { // Nothing to do. Endpoint requested a close and there is no // longer a processor associated with this socket. return SocketState.CLOSED; @@ -737,8 +739,6 @@ public abstract class AbstractProtocol<S // Associate the processor with the connection connections.put(socket, processor); - // Make sure an async timeout doesn't fire - getProtocol().removeWaitingProcessor(processor); SocketState state = SocketState.CLOSED; do { Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1772319&r1=1772318&r2=1772319&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Dec 2 09:09:46 2016 @@ -194,6 +194,11 @@ <bug>60436</bug>: Avoid a potential NPE when processing async timeouts. (markt) </fix> + <fix> + Reduce the window in which an async request that has just started + processing on a container thread remains eligible for an async timeout. + (markt) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org