prabhatbhattarai / project-voldemort

Automatically exported from code.google.com/p/project-voldemort
Apache License 2.0
0 stars 0 forks source link

Keep Alives Problematic with HttpStoreClientFactory #379

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set up a voldemort client that uses HttpStoreClientFactory and talk to a 
server that allows keep-alives
2. Issue a request and wait for the keep-alive idle time to expire
3. Issue another request and the http request fails

What is the expected output? What do you see instead?
The second http request should not fail but it does

What version of the product are you using? On what operating system?
.90.1

Please provide any additional information below.
I think Apache's HttpClient needs the stale connection checking to be set to 
true to properly deal with keep alives, but it's hard-coded to false inside 
HttpStoreClientFactory.

What I'm seeing is this: I'm talking to a server that closes a kept-alive 
connection after 60 seconds of idleness.  Once this happens, HttpClient throws 
an exception on the next request.  When I sniffed the connection, I saw the 
server side close it's side of the connection after 60 seconds, but the 
HttpClient never closed it's side of the connection and tried to re-use the old 
one after the server had closed it, resulting in an exception.

In my past dealings with HttpClient, I needed to have stale checking enabled 
for it (the client in this case) to properly close it's side of the connection 
when needed.

This notion is supported by the HttpClient documentation: 
http://hc.apache.org/httpclient-3.x/performance.html#Stale_connection_check

I see that code has recently been checked in to use HttpClient 4, but it is 
also setting stale checking to false.

Can this be changed to be a configurable value instead?

Original issue reported on code.google.com by mikeboy...@gmail.com on 9 Feb 2012 at 9:14

GoogleCodeExporter commented 8 years ago
Do people generally deploy with keep-alives disabled for fault tolerance 
reasons?

Original comment by mikeboy...@gmail.com on 14 Feb 2012 at 2:46