This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new ac57ef1ae3 Make asynchronous error handling more robust. ac57ef1ae3 is described below commit ac57ef1ae3097f67a5eb4c56a69fbf3e8e926dc3 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jan 24 14:55:06 2024 +0000 Make asynchronous error handling more robust. Ensure that once a connection is marked to be closed, further asynchronous processing cannot change that. --- java/org/apache/coyote/AbstractProcessorLight.java | 7 ++++++- webapps/docs/changelog.xml | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/java/org/apache/coyote/AbstractProcessorLight.java b/java/org/apache/coyote/AbstractProcessorLight.java index 21515c70d7..fdd0d194fe 100644 --- a/java/org/apache/coyote/AbstractProcessorLight.java +++ b/java/org/apache/coyote/AbstractProcessorLight.java @@ -74,7 +74,12 @@ public abstract class AbstractProcessorLight implements Processor { "Socket: [" + socketWrapper + "], Status in: [" + status + "], State out: [" + state + "]"); } - if (isAsync()) { + /* + * If state is already CLOSED don't call asyncPostProcess() as that will likely change the the state to some + * other value causing processing to continue when it should cease. The AsyncStateMachine will be recycled + * as part of the Processor clean-up on CLOSED so it doesn't matter what state it is left in at this point. + */ + if (isAsync() && state != SocketState.CLOSED) { state = asyncPostProcess(); if (getLog().isDebugEnabled()) { getLog().debug( diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index ce5c7c1d2e..d64abaed8c 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -114,7 +114,16 @@ </fix> </changelog> </subsection> - <subsection name="WebSocket"> + <subsection name="Coyote"> + <changelog> + <fix> + Make asynchronous error handling more robust. Ensure that once a + connection is marked to be closed, further asynchronous processing + cannot change that. (markt) + </fix> + </changelog> + </subsection> + <subsection name="WebSocket"> <changelog> <fix> Correct a regression in the fix for <bug>66508</bug> that could cause an --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org