Polish Servlet async request processing

* Clarify semantics and behavior of AsyncWebRequest methods in most cases
making a best effort and not raising an exception if async processing
has completed for example due to a timeout. The startAsync() method is
still protected with various checks and will raise ISE under a number
of conditions.
* Return 503 (service unavailable) when requests time out.
* Logging improvements.

Issue: SPR-8517
This commit is contained in:
Rossen Stoyanchev
2012-04-23 11:20:17 -04:00
parent 699de7eb80
commit f37efb4279
7 changed files with 77 additions and 69 deletions

View File

@@ -398,10 +398,10 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter i
}
/**
* Set the timeout for asynchronous request processing. When the timeout
* begins depends on the underlying async technology. With the Servlet 3
* async support the timeout begins after the main processing thread has
* exited and has been returned to the container pool.
* Set the timeout for asynchronous request processing in milliseconds.
* When the timeout begins depends on the underlying async technology.
* With the Servlet 3 async support the timeout begins after the main
* processing thread has exited and has been returned to the container pool.
* <p>If a value is not provided, the default timeout of the underlying
* async technology is used (10 seconds on Tomcat with Servlet 3 async).
*/

View File

@@ -126,6 +126,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
return new AbstractDelegatingCallable() {
public Object call() throws Exception {
mavContainer.setRequestHandled(false);
new CallableHandlerMethod(getNextCallable()).invokeAndHandle(webRequest, mavContainer, providedArgs);
return null;
}