[CSHARP-2018] 2.3.0 driver does not honor ConnectTimeout setting Created: 19/Jul/17 Updated: 27/Oct/23 Resolved: 19/Jul/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Raphael Londner | Assignee: | Robert Stam |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Server 2012, Visual Studio 2017 Preview, Azure Functions |
||
| Description |
|
I setting the ConnectTimeout property with the following code: MongoUrl mongoUrl = new MongoUrl(strMongoDBAtlasUri); while using a MongoDB Atlas URI (strMongoDBAtlasUri above). I purposely provide incorrect user credentials in the Uri, but the exception is still thrown after 30 seconds (default value) instead of the 5 seconds I specified above. The error message is the following: Message "A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector { AllowedLatencyRange = 00:00:00.0150000 }}. Client view of cluster state is { ClusterId : \"1\", ConnectionMode : \"ReplicaSet\", Type : \"ReplicaSet\", State : \"Disconnected\", Servers : [{ ServerId: \" { ClusterId : 1, EndPoint : \"Unspecified/cluster0-shard-00-00-nebpx.mongodb.net:27017\" }\", EndPoint: \"Unspecified/cluster0-shard-00-00-nebpx.mongodb.net:27017\", State: \"Disconnected\", Type: \"Unknown\", HeartbeatException: \"MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. -- |
| Comments |
| Comment by Raphael Londner [ 19/Jul/17 ] |
|
I have verified that ServerSelectiontimeout works and should be used in this case. This ticket can be closed now. |