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:
@@ -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).
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user