httpclient
httpclient copied to clipboard
HTTPClient::KeepAliveDisconnected: Connection reset by peer
HTTPClient::KeepAliveDisconnected: Connection reset by peer
I'm getting this exception from elasticsearch-ruby gem that uses httpclient.
I believe this exception should be handled inside httpclient itself. Because you can always reconnect.
We switched to typhoeus
for now.
@bogdanovich Thanks for filing this issue. HTTPClient has retry and it should reconnect I thought. Could you please show a stacktrace for your problem?
I am getting many of these errors as well with POST. Stacktrace:
gems/httpclient-2.8.0/lib/httpclient/session.rb:800:in `rescue in block in parse_header': HTTPClient::KeepAliveDisconnected: Connection reset by peer @ io_fillbuf - fd:142 (HTTPClient::KeepAliveDisconnected)
from gems/httpclient-2.8.0/lib/httpclient/session.rb:791:in `block in parse_header'
from ruby2.1.x/lib/ruby/2.1.0/timeout.rb:90:in `block in timeout'
from ruby2.1.x/lib/ruby/2.1.0/timeout.rb:100:in `call'
from ruby2.1.x/lib/ruby/2.1.0/timeout.rb:100:in `timeout'
from gems/httpclient-2.8.0/lib/httpclient/session.rb:788:in `parse_header'
from gems/httpclient-2.8.0/lib/httpclient/session.rb:771:in `read_header'
from gems/httpclient-2.8.0/lib/httpclient/session.rb:547:in `get_header'
from gems/httpclient-2.8.0/lib/httpclient.rb:1294:in `do_get_header'
from gems/httpclient-2.8.0/lib/httpclient.rb:1241:in `do_get_block'
from gems/httpclient-2.8.0/lib/httpclient.rb:1021:in `block in do_request'
from gems/httpclient-2.8.0/lib/httpclient.rb:1134:in `rescue in protect_keep_alive_disconnected'
from gems/httpclient-2.8.0/lib/httpclient.rb:1128:in `protect_keep_alive_disconnected'
from gems/httpclient-2.8.0/lib/httpclient.rb:1016:in `do_request'
from gems/httpclient-2.8.0/lib/httpclient.rb:858:in `request'
from gems/httpclient-2.8.0/lib/httpclient.rb:761:in `post'