Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connections leak when setting TLS 1.2 through the connection string #304

Closed
jesuissur opened this issue Jul 30, 2020 · 2 comments
Closed

Comments

@jesuissur
Copy link

When we set SSL to TLS 1.2 through the connection string (as stated in this issue) and we upgraded from 5.5.0 to 6.3.4, our Redis clients connections went through the roof.

With the 5.5.0 version, our connections count floats around 600 for our app.
With the 6.3.4 version and the TLS configuration through the connection string, we've seen thousands of connections (as many as our server allowed, 10K).

To Reproduce
Our initial configuration (with the 5.5.0 version and same StackExchange.Redis package) was something like this:

            return new RedisConfiguration
                   {
                       KeyPrefix = _cachingOptions.Value.InstanceName,
                       AbortOnConnectFail = false,
                       Ssl = _cachingOptions.Value.Ssl,
                       Password = _cachingOptions.Value.Password,
                       SyncTimeout = 5000,
                       PoolSize = 20,
                       Hosts = new[] {new RedisHost {Host = _cachingOptions.Value.Host, Port = _cachingOptions.Value.Port}}
                   };
  

And after the upgrade to 6.3.4 and supports for TLS 1.2, the config looked like that

            var underlyingRedisClientConfig = new ConfigurationOptions
                                              {
                                                  AbortOnConnectFail = false,
                                                  Password = _cachingOptions.Value.Password,
                                                  Ssl = _cachingOptions.Value.Ssl,
                                                  SslProtocols = SslProtocols.Tls12,
                                                  SyncTimeout = 5000
                                              };
            var endPoint = new DnsEndPoint(_cachingOptions.Value.Host, _cachingOptions.Value.Port);
            underlyingRedisClientConfig.EndPoints.Add(endPoint);

            return new RedisConfiguration
                   {
                       ConnectionString = underlyingRedisClientConfig.ToString(true),
                       KeyPrefix = _cachingOptions.Value.InstanceName,
                       PoolSize = 20
                   };
 

Expected behavior
No more connections than expected (before upgrading).

Env: Azure Windows App Services:

  • .Net framework 4.7 and .Net Core 2.2
  • StackExchange.Redis.Extensions 6.3.4
  • StackExchange.Redis 2.1.58
@imperugo
Copy link
Owner

imperugo commented Sep 1, 2020

please take a look to 6.3.5 that is on nuget now.

Basically I've removed the invalidate part / reconnect because the multiplex does it automatically. The connection management is like the 5.x version.
Let me know

@imperugo imperugo added the bug label Sep 1, 2020
@imperugo
Copy link
Owner

Old issue, going to close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants