elastic / elastic/elasticsearch-ruby

HTTPClient::KeepAliveDisconnected when the node request is timing out

オープン
#1,032 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Ruby
スター
2k
フォーク
615
PR マージ指標
30日以内にマージされた PR はありません

説明

I am initializing my connection like

`Elasticsearch::Client.new hosts: ['https://:9200', 'https://:9200']`.
with following options - {reload_on_failure: true, reload_connections: true}.

Whenever there is request timeout on any of these nodes, I am getting the following traceback -
`Traceback (most recent call last):
from faraday (0.9.2) lib/faraday/connection.rb:377:in `run_request'
from faraday (0.9.2) lib/faraday/rack_builder.rb:139:in `build_response'
from faraday (0.9.2) lib/faraday/adapter/httpclient.rb:36:in `call'
from httpclient (2.7.2) lib/httpclient.rb:858:in `request'
from httpclient (2.7.2) lib/httpclient.rb:1016:in `do_request'
from httpclient (2.7.2) lib/httpclient.rb:1127:in `protect_keep_alive_disconnected'
from httpclient (2.7.2) lib/httpclient.rb:1134:in `rescue in protect_keep_alive_disconnected'
from httpclient (2.7.2) lib/httpclient.rb:1021:in `block in do_request'
from httpclient (2.7.2) lib/httpclient.rb:1241:in `do_get_block'
from httpclient (2.7.2) lib/httpclient.rb:1294:in `do_get_header'
from httpclient (2.7.2) lib/httpclient/session.rb:547:in `get_header'
from httpclient (2.7.2) lib/httpclient/session.rb:771:in `read_header'
from httpclient (2.7.2) lib/httpclient/session.rb:788:in `parse_header'
from /opt/ruby-2.7.1/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
from /opt/ruby-2.7.1/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
from httpclient (2.7.2) lib/httpclient/session.rb:795:in `block in parse_header'
HTTPClient::KeepAliveDisconnected (HTTPClient::KeepAliveDisconnected: )`

I see that in elasticsearch-transport-5.0.5/lib/elasticsearch/transport/transport/http/faraday.rb, we have defined

`def host_unreachable_exceptions
[::Faraday::Error::ConnectionFailed, ::Faraday::Error::TimeoutError]
end`

then why is TimeoutError is not reloading connection, instead giving the above exception.

To verify this, I did a curl on the same node and the request did timeout but from the gem, i am facing some issues

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。