StackExchange / StackExchange/StackExchange.Redis
Cluster - Connecting to 0.0.0.0:6379 for some reason
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 1.6k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Hello there,
I am connecting to a cluster with 1 master and 2 replicas. The code is pretty simple:
var configuration = new ConfigurationOptions();
configuration.EndPoints.Add("10.254.61.60", 6379);
configuration.EndPoints.Add("10.254.61.61", 6379);
configuration.EndPoints.Add("10.254.61.62", 6379);
configuration.Ssl = true;
configuration.User = "admin";
configuration.Password = "password";
configuration.CertificateValidation += (object sender, X509Certificate? certificate, X509Chain? chain, SslPolicyErrors sslPolicyErrors) => { return true; };
// 5 seconds
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(configuration, Console.Out);
But the connection takes up to 5 seconds, because for some reason the client is trying to connect to a 0.0.0.0:6379 endpoint and it takes it 4.7 seconds to fail. I have no idea why it would try to do that. There is no error in the logs nor any explanation I could find.
logs.txt
P.S. the cert verification is required because we are using certs signed by our internal CA which my local PC doesn't trust. The app running in production doesn't have that line but does have the same issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with logs.txt and the ConnectionMultiplexer.Connect call, then trace how the three configured endpoints and cluster-discovered endpoints are processed. Reproduce the 0.0.0.0:6379 attempt and determine its source; done means the cause is explained and the connection no longer incurs the unexplained delay, with a regression test if the behavior is changed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, redis
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100