-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fixes for OSGi, remove automatic creation of executor for async requests (WIP) #569
base: master
Are you sure you want to change the base?
Fixes for OSGi, remove automatic creation of executor for async requests (WIP) #569
Conversation
@gflores-jahia Thank you for your work on this! I convert it to draft: ping me when it will be ready for a final review! |
@federicorispo I wonder if you have an opinion regarding the original PR fix of removing ThreadPoolExecutor completely. It looks like this might be a breaking change. It looks like that we no longer have a default async executor, and users will need to provide one if they want to handle async tasks. But because configuration and HttpInvoker is still created for every request, this to me still doesn't fix the original issue of being able to clean up thread pools. Instead of completely removing the default ThreadPoolExecutor, I wonder if you have ideas on how to properly clean them after execution. In the meantime will need to put this on hold until we get a good consensus of proper way to fix ThreadPools constantly being created on every http request |
@gflores-jahia I will look in the current flow of the request handling to see if there is a clean and solid way to better handle thread after the execution. A good refactor is certainly needed |
I've made a deep analysis of the codebase and I confirmed the presence of a thread/memory leak in the return getConfiguration().getHttpRequestHandler().handle(request, response); Here's a breakdown of the process:
The main issue with the OsgiGraphQLHttpServlet's behavior is that the getConfiguration method calls
Now that I have a better understanding of the process, I wouldn't remove the implicit ThreadPool creation because, if the GraphQLConfiguration is correctly created (as in the GraphQLHttpServlet and OsgiGraphQLHttpServlet, thanks to this PR), it will be automatically handled by the GraphQLConfiguration itself. Additionally, the My only remaining doubt is when the GraphQLConfiguration created by the GraphQLConfigurationProvider is built. I've only seen the |
WORK IN PROGRESS
Creating new PR based off of #538 and branched off latest master code.