Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure default settings for Servlet async request timeout for WebFlux [SPR-15463] #20023

spring-projects-issues opened this issue Apr 19, 2017 · 0 comments
in: web type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Apr 19, 2017

Rossen Stoyanchev opened SPR-15463 and commented

The timeout for Servlet 3.0 async requests is defined roughly as the time between ServletRequest#startAsync and calls to either AsyncContext#dispatch or AsyncContext#complete.

In WebFlux we call ServletRequest#startAsync automatically and then use Servlet 3.1 non-blocking I/O with AsyncContext#complete at the end. The dispatch does not fit into our processing model which is not based on the Servlet API to begin with and we call startAsync quite early, way before we could know if the request will require streaming or not.

For now our only option is to set the AsyncContext to never time out (-1) in order to make streaming scenarios possible. The downside is the lack of protection for non-streaming requests but then again even in the Servlet API there is no protection against regular requests taking indefinitely to process.

It should also be noted that both Reactor and RxJava provide timeout operators so that's something natural to express. In the future we can consider implementing a timeout feature that's built into the Spring WebFlux processing model and works across all runtimes. For example a timeout composed on the Mono<Void> returned from the HttpHandler.

Affects: 5.0 M5

Issue Links:

  • #20228 Disable Servlet request async timeout for reactive type streaming scenarios in Spring MVC

Referenced from: commits 4f3db9b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: web type: enhancement
None yet

No branches or pull requests

2 participants