I am using NEST to perform queries towards an Elasticsearch 6-cluster. The Elasticsearch cluster consists of a couple of nodes, but it's running behind a firewall/loadbalancer so from the client perspective it appears as a single node with a single host name.
When new versions of my application are deployed, there are short network interruptions due to how the infrastructure/network works when it comes to blue-green deployments.
Since I only have a single Elasticsearch URI, NEST will use a SingleNodeConnectionPool
instance when I create the connection. I have read in the documentation that with when this is the case, NEST won't perform any retries.
But in my case, I want to perform retries to handle the above network interruptions, since it's currently causes errors to be propagated to end-users. I understand i could implement rerty logic myself, but I was wondering if there's some way to get retry logic for network connection errors even when using SingleNodeConnectionPool.
The error I'm getting in my code is:
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <server-ip>:<server-port>