twitter/commons — Issue #9: Implementing a reaper for cleaning up the idle connections
Author: avadh
Created: 2011-12-28 08:06:35+00:00
State: open

I am having a setup as shown below:

Client(s) ----> LB ----> Thrift Server(s)

Here LB is a hardware loadbalancer which balances the load across thrift servers for the various incoming requests from the client(s). The client is using a connection pool as provided by "com.twitter.common.net.pool.ConnectionPool".
I am having a requirement of providing an "idle-connection-timeout" value at client side, so that I can timeout a connection from the client side when not in use for a specified period of time. As I was digging deep into the client code, I came across this "ConnectionPool" class and find the below mentioned TODO:

TODO(John Sirois): implement a reaper to clean up connections that may become invalid when not in use.

And this is exactly what I am looking for. :-)

Is there any plan/update on fixing this? If not, then is there any workaround to display a similar behavior from the client?