Author: markt Date: Tue Jul 28 12:57:49 2015 New Revision: 1693088 URL: http://svn.apache.org/r1693088 Log: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58103 When pipelining requests, and the previous request was an async request, ensure that the socket is removed from the waiting requests so that the async timeout thread doesn't process it during the next request.
Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1693088&r1=1693087&r2=1693088&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Tue Jul 28 12:57:49 2015 @@ -703,6 +703,11 @@ public abstract class AbstractProtocol<S state = processor.dispatch(status); } else if (state == SocketState.ASYNC_END) { state = processor.dispatch(status); + // release() won't get called so in case this request + // takes a long time to process remove the socket from + // the waiting requests now else the async timeout will + // fire + getProtocol().getEndpoint().removeWaitingRequest(wrapper); if (state == SocketState.OPEN) { // There may be pipe-lined data to read. If the data // isn't processed now, execution will exit this Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1693088&r1=1693087&r2=1693088&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Tue Jul 28 12:57:49 2015 @@ -993,6 +993,9 @@ public abstract class AbstractEndpoint<S protected final Set<SocketWrapperBase<S>> waitingRequests = Collections .newSetFromMap(new ConcurrentHashMap<SocketWrapperBase<S>, Boolean>()); + public void removeWaitingRequest(SocketWrapperBase<S> socketWrapper) { + waitingRequests.remove(socketWrapper); + } /** * The async timeout thread. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org