-
Notifications
You must be signed in to change notification settings - Fork 250
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
Connection pool leak via Apache Async Http Client? #923
Comments
Hello! This is the first report of this kind, so I don't really know what could be the cause, it could very much be an internal issue within the Apache Async HTTP Client. Is it possible to get a snippet of the client initialization code, when the transport client (the one that uses the Apache client) is created and passed to the java client? Also since I see that spring is involved I'd suggest double checking if there's other apache dependencies that could interfere with the transitive one from the java client. |
Hi, thanks for your reply! I need to check the transitive dependencies, thats a good point! Below is a snippet of how the client is initialised. We explicitly set values for connection timeout etc. as of now to mitigate the persisted connections that stayed open in the connection pool. For other clients we did not observe such a behaviour but only for connections via the Elasticsearch Java Client using the Apache Async Http Client.
Thanks a lot & have a nice day! |
So, it looks like the leasingRequest LinkedList in PoolingNHttpClientConnectionManager keeps growing. I found this interesting old issue in the elasticsearch server repository which looks very similar to what's happening here, and was solved by removing the maxRetryTimeout parameter. Just to be sure I'd again suggest checking the transitive dependencies to make sure that the transport version (the |
Java API client version
8.16.1
Java version
21
Elasticsearch Version
8.16.1
Problem description
Hello,
we are suffering from a hard to debug resource leak on our components using the Elasticsearch Client which we are currently investigating. The symptoms will occur on deployments after multiple days/ weeks and will lead to the corresponding pod which carries the deployment to be "stuck". Requests reaching the pod are essentially stuck and no new requests will be distributed to the individual pod until restarted.
The issue is unfortunately hard to reproduce locally. From a heapdump of an affected instance I was able to retrieve the following information which pointed us in the direction of the Apache Async HTTP Client used by the Low Level Elasticsearch Rest Client.
We are using the Elasticsearch client in a conventional way from a reactive context like this:
Wondering if you observed similar issues in the past or if you have an idea what the source of the issue could be.
The issue was also present in version prior to 8.16.1 as it seems.
Thanks a lot!
Best Regards
Sven S.
Edit:
A workaround which we found so far is to specify a short TTL for the connection of the http client itself.
The text was updated successfully, but these errors were encountered: