elasticsearch-net: Cannot assign request address

NEST/Elasticsearch.Net version:6.6

Elasticsearch version:6.7

Description of the problem including expected versus actual behavior: When big data index IB BIMMD}BWZPNM930NK}OK

Steps to reproduce: 1. 2. 3.

Provide ConnectionSettings (if relevant): var path = Environment.GetEnvironmentVariable(“ESURL”); if (string.IsNullOrWhiteSpace(path)) { throw new Exception(“the Environment vairable ESURL is not exist”); }

        var pathArr = path.Split(",", StringSplitOptions.RemoveEmptyEntries);
        IEnumerable<Uri> nodes = pathArr.ToList().Select(s => new Uri(s));
        var pool = new StaticConnectionPool(nodes);
        var settings = new ConnectionSettings(pool).DefaultTypeName(ESClient.DOCUMENTTYPE).ConnectionLimit(1000);

Provide DebugInformation (if relevant):

Describe the feature:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

Looks like this may be dotnet/corefx#37044

Not the same Exception, I have restored the configuration “ConnectionLimit” to 80, and cancel the ping request for single ES node, I saw the connection had been recycled。 Hope these will help !
I will continue to follow up and update . Thanks for your help , @russcam @Mpdreamz

Thanks for the detailed response!

I have reported on socket reuse issues on linux with .NET Core before:

dotnet/corefx#21227

It’s one of the reasons our connection limit on linux is so conservative

https://github.com/elastic/elasticsearch-net/blob/master/src/Elasticsearch.Net/Configuration/ConnectionConfiguration.cs#L24

Going from Environment.ProcessorCount to 1000 might amplify the bleed.

Are you compiling AND running on .NET Core 2.1? Can you share the <TargetFramework> of your csproj?

I am sorry, the information provided before is a bit wrong.

I confirmed that the dotnet runtime of application is using version 2.2, compiling and running on .NET Core 2.2 .

The <TargetFramework> of edoc2 application is .NET Core 2.2 .

Output of dotnet --info

root@edoc2:/app# dotnet --info

Host (useful for support):
  Version: 2.2.4
  Commit:  f95848e524

.NET Core SDKs installed:
  No SDKs were found.

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

The logs are written very frequently and we have not implemented bulk writes yet.

Before trying to modify the default value 80 to 1000, i have tried the default value of “80”, also got an exception Cannot assign request address, I thought it would be fine to increase this value,however it doesn’t work and large amount of ESTABLISHED connection appear