[CSHARP-2086] Inconsistent MongoClient Connection Behavior- Timeout depending upon connection setup Created: 01/Nov/17 Updated: 09/Feb/22 Resolved: 09/Feb/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.4.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bret Ferrier | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
.Net Full, Windows Server 2012 |
||
| Description |
|
So I have a long running Windows Service that is performing a few dozen tasks each of which read/write to two different mongo servers (one being a 3 member replica set and the other being a single member replica set). The MongoClients for all processes are being handled by a Singleton. This has been up and running for a year+ with no issues using the following code to acquire a MongoClient. ``` ``` }; _client = new MongoClient(mongoClientSettings); Now with the Example above the Action used for tracking is in fact null as this process isn't collecting any analytics on performance. ``` }. Client view of cluster state is { ClusterId : "8536", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: " { ClusterId : 8536, EndPoint : "Unspecified/someserver.in.datacenter.com:27017" }", EndPoint: "Unspecified/someserver.in.datacenter.com:27017", State: "Disconnected", Type: "Unknown" }] }. We get the error for both servers each erroring out independently. No changes are made to the connection string between the failing and error-less execution path. |
| Comments |
| Comment by James Kovacs [ 09/Feb/22 ] |
|
ClusterConfigurator defines an Action<ClusterBuilder> delegate to run when a new cluster is created. If the delegate does not execute any code, then it cannot modify the default cluster configuration and thus cannot impact cluster connectivity. If you encounter a similar issue in the future, we encourage you to reach out to the following channels to help diagnose the issue:
|