This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new a4f27a6509 Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled a4f27a6509 is described below commit a4f27a65094bfcec8ed8c757b531a41cfc08c7f4 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Mar 15 19:37:48 2024 +0000 Fix test failure. Throw ISE rather than NPE if AsyncContext is recycled Note: test failure is intermittent --- java/org/apache/catalina/core/AsyncContextImpl.java | 2 ++ webapps/docs/changelog.xml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java index 832e9b61bc..f2a1a3487e 100644 --- a/java/org/apache/catalina/core/AsyncContextImpl.java +++ b/java/org/apache/catalina/core/AsyncContextImpl.java @@ -292,6 +292,8 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback { public boolean isStarted() { AtomicBoolean result = new AtomicBoolean(false); + Request request = this.request; + check(); request.getCoyoteRequest().action(ActionCode.ASYNC_IS_STARTED, result); return result.get(); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 981ae76a04..07f1af22c5 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -118,6 +118,12 @@ build-date to the SecurityListener, and log a warning if the server is old. (schultz) </add> + <fix> + When using the <code>AsyncContext</code>, throw an + <code>IllegalStateException</code>, rather than allowing an + <code>NullPointerException</code>, if an attempt is made to use the + <code>AsyncContext</code> after it has been recycled. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org