JanusGraph / janusgraph

JanusGraph: an open-source, distributed graph database
https://janusgraph.org
Other
5.32k stars 1.17k forks source link

Custom Keep-Alive strategy for ES client #2167

Closed debelyoo closed 4 years ago

debelyoo commented 4 years ago

Describe the feature: Allow custom Keep-Alive strategy for ES rest client.

Describe a specific use case for the feature: In our current network setup, there are strict FW rules that trigger every 30 minutes and close the open connections between the cluster nodes. We thus observe Connection reset by peer errors between JanusGraph and ES, similar to the errors described in this post: https://stackoverflow.com/questions/52997697/how-to-get-around-connection-reset-by-peer-when-using-elasticsearchs-restclie. Using a custom Keep-Alive strategy (with a fairly short timeout) will prevent ES rest client to use a connection that has been idle for long and that may be broken due to the strict FW rules.

lionelfleury commented 4 years ago

Indeed. It looks like the ES nodes don't set any Keep-Alive header.

So setting it at HttpClient level might be reasonable IMO.

Refs.: