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

Run async task in thread pool separated from HTTP worker pool #347

Closed
oliemansm opened this issue May 19, 2021 · 0 comments · Fixed by #349
Closed

Run async task in thread pool separated from HTTP worker pool #347

oliemansm opened this issue May 19, 2021 · 0 comments · Fixed by #349
Milestone

Comments

@oliemansm
Copy link
Member

oliemansm commented May 19, 2021

Is your feature request related to a problem? Please describe.
The default AsyncContext.start(Runnable) is used to run the GraphQL request in a separate Thread when enabled. The default implementation by the servlet containers (e.g. Tomcat, Jetty) is to use a Thread of the HTTP worker thread pool. Defeating the purpose of running it in a separate Thread in the first place, since it's then still blocking a HTTP worker thread. See this article for a thorough explanation of this issue, which also discusses the concern whether there's a benefit of using this feature at all.

Describe the solution you'd like
People of this library might still want to be able to use this functionality, but as described in the original feature request the main idea is that it would spawn in a different Thread pool and it would stop blocking HTTP worker Threads. It should be possible to provide your own executor pool that should be used instead.

Example implementation: https://developerlife.com/2011/04/13/creating-asynchronous-servlets-with-tomcat-7-servlet-3-0-api/.

@oliemansm oliemansm added this to the 11.2.0 milestone May 19, 2021
@oliemansm oliemansm changed the title Async execution spawns thread in HTTP worker pool instead of separate async pool Run async task in separate async executor pool instead of in HTTP worker pool May 19, 2021
@oliemansm oliemansm changed the title Run async task in separate async executor pool instead of in HTTP worker pool Run async task in thread pool separated from HTTP worker pool May 19, 2021
oliemansm added a commit that referenced this issue May 19, 2021
@oliemansm oliemansm linked a pull request May 19, 2021 that will close this issue
@oliemansm oliemansm modified the milestones: 11.2.0, 12.0.0 Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant