We are currently using HttpClient 3.1 and running into
NoHttpResponseException (server failed to respond), Connection Reset
errors under load.
One of the solutions, I found searching use list is to "Retry" the
request.
I reviewed Default Retry Handler code in version 3.1 and 4.1 and found
that NoHttpResponseException is not retried in 4.1 be default.
In addition, The "ConnectException" is also not retried. Any reasons?
3.1 code:
if (executionCount > this.retryCount) {
// Do not retry if over max retry count
return false;
}
if (exception instanceof NoHttpResponseException) {
// Retry if the server dropped connection on us
return true;
}
4.1 Code:
if (executionCount > this.retryCount) {
// Do not retry if over max retry count
return false;
}
if (exception instanceof InterruptedIOException) {
// Timeout
return false;
}
if (exception instanceof UnknownHostException) {
// Unknown host
return false;
}
if (exception instanceof ConnectException) {
// Connection refused
return false;
}
While I may be okay retrying requests, I am wondering whether I could
avoid this error as much as possible(not eliminate completely) or make
it less occurrence using Keep-Alive timeout.
My current client keep alive timeout on server is 60 seconds. Would it
help increasing this further?
Thanks.
______________________________________________________________________
The information contained in this message is proprietary and/or confidential.
If you are not the intended recipient, please: (i) delete the message and all
copies; (ii) do not disclose, distribute or use the message in any manner; and
(iii) notify the sender immediately. In addition, please be aware that any
message addressed to our domain is subject to archiving and review by persons
other than the intended recipient. Thank you.