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

New ThreadPool are constantly being created on every http request #537

Open
tdraier opened this issue Sep 15, 2023 · 2 comments
Open

New ThreadPool are constantly being created on every http request #537

tdraier opened this issue Sep 15, 2023 · 2 comments
Labels

Comments

@tdraier
Copy link
Contributor

tdraier commented Sep 15, 2023

Describe the bug
When using OsgiGraphQLHttpServlet, a new thread pool (of 1 thread) is created on every request, and never shut down.
The thread pool is created when creating a GraphQLConfiguration - if no asyncExecutor was provided (which is not possible when using OsgiGraphQLHttpServlet), a new ThreadPoolExecutor is created, without keeping any reference on it, and so never shutting it down. Creating a thread pool transparently without shutting it down is already an issue, but moreover OsgiGraphQLHttpServlet.getConfiguration() is creating a new configuration on every call, which is actually happening in AbstractGraphQLHttpServlet.doRequest() .

To Reproduce
Steps to reproduce the behavior:

  1. Create an OsgiGraphQLHttpServlet
  2. Make http requests
  3. Check the total number of threads

Expected behavior

  • Don't create a pool automatically, or ensure it's properly closed when it's not used anymore
  • Don't build new configuration every time we call getConfiguration
  • Make it possible to pass a custom pool when using OsgiGraphQLHttpServlet. Ideally, it would be nice to be able to pass a full configuration (maybe through a "GraphQLConfigurationProvider")

I will try to provide a PR soon

@tdraier
Copy link
Contributor Author

tdraier commented Oct 23, 2023

Hi,

Any news on this ? Did anybody have a chance to look at the PR ?

@federicorispo
Copy link
Member

@tdraier Thanks for your PR. I will look into it in the next few days 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants