This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 3e2fb5786f46f2051f5839bba9b702bdd708586b Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Mar 5 17:27:12 2020 +0000 Differentiate between error conditions and clean shutdown. Allow an async request to complete cleanly if the Connector is paused before complete() is called on a Container thread. --- java/org/apache/coyote/AbstractProtocol.java | 2 +- java/org/apache/coyote/ajp/AbstractAjpProcessor.java | 2 +- java/org/apache/coyote/http11/AbstractHttp11Processor.java | 2 +- webapps/docs/changelog.xml | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java index b18c087..0bbd92d 100644 --- a/java/org/apache/coyote/AbstractProtocol.java +++ b/java/org/apache/coyote/AbstractProtocol.java @@ -654,7 +654,7 @@ public abstract class AbstractProtocol<S> implements ProtocolHandler, state = processor.process(wrapper); } - if (state != SocketState.CLOSED && processor.isAsync()) { + if (processor.isAsync()) { state = processor.asyncPostProcess(); } diff --git a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java index 200843c..7d6cae1 100644 --- a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java +++ b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java @@ -620,7 +620,7 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> { } } else { request.updateCounters(); - if (getErrorState().isError()) { + if (getErrorState().isError() || endpoint.isPaused()) { state = SocketState.CLOSED; } else { recycle(false); diff --git a/java/org/apache/coyote/http11/AbstractHttp11Processor.java b/java/org/apache/coyote/http11/AbstractHttp11Processor.java index e5dacca..8453067 100644 --- a/java/org/apache/coyote/http11/AbstractHttp11Processor.java +++ b/java/org/apache/coyote/http11/AbstractHttp11Processor.java @@ -1847,7 +1847,7 @@ public abstract class AbstractHttp11Processor<S> extends AbstractProcessor<S> { } else if (isAsync()) { state = SocketState.LONG; } else { - if (!keepAlive) { + if (!keepAlive || endpoint.isPaused()) { state = SocketState.CLOSED; } else { endRequest(); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index cae5397..d9d5e83 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -114,6 +114,10 @@ A zero length AJP secret will now behave as if it has not been specified. (remm) </fix> + <fix> + Allow async requests to complete cleanly when the Connector is paused + before <code>complete()</code> is called on a container thread. (markt) + </fix> </changelog> </subsection> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org