# NEST: Performing retries with a single node

**URL:** <https://discuss.elastic.co/t/nest-performing-retries-with-a-single-node/255373>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [November 13, 2020, 7:13pm UTC](https://discuss.elastic.co/t/nest-performing-retries-with-a-single-node/255373 "2020-11-13T19:13:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![knafve](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@knafve](https://discuss.elastic.co/u/knafve)\
**Post date:** [November 13, 2020, 7:13pm UTC](https://discuss.elastic.co/t/nest-performing-retries-with-a-single-node/255373/1 "2020-11-13T19:13:49Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/maximum-retries-per-request.html) 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>
```

---

<div class="post-metadata">

**Author:** ![Henrique\_Mauri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henrique_mauri/32/61647_2.png) [@Henrique\_Mauri](https://discuss.elastic.co/u/Henrique_Mauri)\
**Post date:** [December 2, 2020, 10:15pm UTC](https://discuss.elastic.co/t/nest-performing-retries-with-a-single-node/255373/2 "2020-12-02T22:15:43Z")

</div>

> [@knafve](#):
>
> `SingleNodeConnectionPool`

Hello Knafve

I made some examples of queries on github using NEST in .net core, take a look there if it helps: [GitHub - hgmauri/elasticsearch-with-nest: Example of using Elasticsearch in Docker with the NEST and Serilog nuget package in .NET 7.0](https://github.com/hgmauri/elasticsearch-with-nest)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 30, 2020, 10:16pm UTC](https://discuss.elastic.co/t/nest-performing-retries-with-a-single-node/255373/3 "2020-12-30T22:16:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
