question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow configuring timeToLive for the connection pool

See original GitHub issue

Is your feature request related to a problem? Please describe. We are having some issues with regards to connection pools when releasing a new version of the service called by the unirest client. This release process involves updating the DNS entry for the load balancer and the clients need to refresh the connections in order to start calling the new version of the service. We’re looking into making it happen by leveraging the timeToLive functionality of the CPool used by the underlying apache client. However, currently it’s really hard to propagate this value to the pool instance and by default, this ttl is infinite.

Describe the solution you’d like Exposing an additional configuration parameter (connectionTimeToLive) in the kong.unirest.Config that would be picked up when initializing the PoolingNHttpClientConnectionManager from the ApacheAsyncClient.

Describe alternatives you’ve considered I’ve considered providing a custom instance of AsyncClient, but that involves a lot of duplication of the code already taken care of by ApacheAsyncClient.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
rybercommented, Jul 26, 2019

2.3.11 is now in maven central and has a new connectionTTL(42, TimeUnit.MILLISECONDS) method on the config to set this.

0reactions
maxcebancommented, Jul 26, 2019

Awesome, thanks so much Ryan! Going to give it a try in prod next week!

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Optimizing Universal Connection Pool Behavior
The following example demonstrates enabling connection harvesting by configuring a connection harvest trigger count. pds.setConnectionHarvestTriggerCount(2); ...
Read more >
c3p0-v0.9.5.5 - JDBC3 Connection and Statement Pooling
c3p0 maintains separate pools for Connections with distinct authentications. The various methods let you query the status of pools individually, or aggregate ...
Read more >
ClientConfiguration (AWS SDK for Java - 1.12.362)
Returns the amount of time (in milliseconds) that a connection can be idle in the connection pool before it must be validated to...
Read more >
Salesforce Connector 10.1.0 Connection Pool Config ...
Salesforce Connector 10.1.0 Connection Pool Config configuration ... TTL: 30 seconds (Unused Object time to live value in connection pool).
Read more >
Chapter 10. Detecting Dead Connections Red Hat AMQ 7.4
Configuring Time-To-Live on the Broker. If you do not want clients to specify their ... The default value is -1 , which allows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found