Skip to content
New issue

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

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

Already on GitHub? # to your account

Idle connection reaper for JestClient #69

Closed
nathan-poquette opened this issue Jul 16, 2018 · 1 comment
Closed

Idle connection reaper for JestClient #69

nathan-poquette opened this issue Jul 16, 2018 · 1 comment

Comments

@nathan-poquette
Copy link
Contributor

I am using spring-data-jest to communicate with AWS Elasticsearch service and have been running into some SocketTimeoutExceptions. My hunch is there are connection(s) in my connection pool which have been terminated by the server due to no activity happening for a certain period of time. After one SocketTimeoutException, a subsequent request seems to make it through.

Looking around in searchbox-io's Jest repo, I noticed an idle connection reaper was put in some time back. However, it appears you must opt-in by setting a maxConnectionIdleTime on the HttpClientConfig when building the JestClient.

Might I propose exposing the ability to configure a maxConnectionIdleTime (via configuration properties), with a default value such that the connection reaper is disabled without setting the property so that it's opt-in functionality? Then consuming this property in the auto configuration class which creates the JestClient. I've opened a PR illustrating this here:

#68

More info here: searchbox-io/Jest#149
With example usage here: https://github.com/searchbox-io/Jest/blob/v2.0.4/jest/src/test/java/io/searchbox/client/JestClientFactoryIntegrationTest.java#L116

Cheers!

@VanRoy
Copy link
Owner

VanRoy commented Jul 18, 2018

Hi @nathan-poquette ,

Thanks a lot for your contribution.

Your commit is available right now in version 3.1.3.RELEASE.

Thanks again.
Julien.

@VanRoy VanRoy closed this as completed Jul 18, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants