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

Tell AsyncHttpClient not to re-use connections for more than 60s #65

Merged
merged 1 commit into from Mar 3, 2015

Conversation

cb372
Copy link
Contributor

@cb372 cb372 commented Feb 24, 2015

After another look through the AsyncHttpClient source code today, it turns out that it is possible to configure its connection pool to solve our DNS caching woes. I've checked with manual testing that this works as expected.

This is a better fix than #64 because it means we can keep Netty, so there are no performance worries.

By default AsyncHttpClient will keep a connection in the pool for ever:
https://github.com/AsyncHttpClient/async-http-client/blob/async-http-client-1.8.10/src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java#L56

The configured value is used here:
https://github.com/AsyncHttpClient/async-http-client/blob/async-http-client-1.8.10/src/main/java/com/ning/http/client/providers/netty/NettyConnectionsPool.java#L178

@mchv @LATaylor-guardian

@mchv
Copy link
Member

mchv commented Feb 24, 2015

👍 great catch!

cb372 added a commit that referenced this pull request Mar 3, 2015
Tell AsyncHttpClient not to re-use connections for more than 60s
@cb372 cb372 merged commit 447d8a6 into master Mar 3, 2015
@cb372 cb372 deleted the limit-connection-lifetime branch March 3, 2015 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants