FAQ

On 29/10/2014 17:29, remm@apache.org wrote:
Author: remm
Date: Wed Oct 29 17:29:19 2014
New Revision: 1635215

URL: http://svn.apache.org/r1635215
Log:
Fix three edgy async context bugs.
OK. Try again :)

-1 veto.

This breaks a requirement of the Servlet 3.1 spec that an ISE should be
thrown if get[Request|Response]() is called after complete() is called.

This commit breaks the unit tests that check this (the calls do not
thrown any exception).

The commit did not include any test cases. What problem are you trying
to solve? And where in the spec does it mandate the behaviour you are
trying to achieve?

I'd really like to get this resolved quickly so it doesn't delay the
8.0.15 tag.

Note that there are now multiple Async unit tests failures and I have
not yet checked them all to see if they have the same root cause.

Mark
Modified:
tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1635215&r1=1635214&r2=1635215&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Wed Oct 29 17:29:19 2014
@@ -84,7 +84,6 @@ public class AsyncContextImpl implements
}
check();
request.getCoyoteRequest().action(ActionCode.ASYNC_COMPLETE, null);
- clearServletRequestResponse();
}

@Override
@@ -104,6 +103,7 @@ public class AsyncContextImpl implements
}
}
} finally {
+ clearServletRequestResponse();
context.unbind(Globals.IS_SECURITY_ENABLED, oldCL);
}

@@ -290,6 +290,10 @@ public class AsyncContextImpl implements
} catch (ClassNotFoundException e) {
ServletException se = new ServletException(e);
throw se;
+ } catch (Exception e) {
+ ExceptionUtils.handleThrowable(e.getCause());
+ ServletException se = new ServletException(e);
+ throw se;
}
return listener;
}

Modified: tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java?rev=1635215&r1=1635214&r2=1635215&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java [UTF-8] (original)
+++ tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java [UTF-8] Wed Oct 29 17:29:19 2014
@@ -109,7 +109,7 @@ public class AsyncStateMachine {
DISPATCHED(false, false, false),
STARTING(true, true, false),
STARTED(true, true, false),
- MUST_COMPLETE(true, false, false),
+ MUST_COMPLETE(true, true, false),
COMPLETING(true, false, false),
TIMING_OUT(true, false, false),
MUST_DISPATCH(true, true, true),

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1635215&r1=1635214&r2=1635215&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Oct 29 17:29:19 2014
@@ -183,6 +183,13 @@
full class path, ensure that class path entries added directly to the
web application class loader are scanned. (markt)
</fix>
+ <fix>
+ AsyncContext should remain usable until fireOnComplete is called. (remm)
+ </fix>
+ <fix>
+ AsyncContext createListener should wrap any instantiation exception
+ using a ServletException. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -219,6 +226,9 @@
<code>AsyncContext.start(Runnable)</code> during non-blocking IO reads
and writes. (markt)
</fix>
+ <fix>
+ Async state MUST_COMPLETE should still be started. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 14 | next ›
Discussion Overview
groupdev @
categoriestomcat
postedOct 29, '14 at 5:29p
activeOct 29, '14 at 10:27p
posts14
users3
websitetomcat.apache.org
irc#tomcat

People

Translate

site design / logo © 2017 Grokbase