[CSHARP-2729] wtimeout accepts value in seconds instead of millisecond Created: 04/Sep/19  Updated: 27/Oct/23  Resolved: 04/Sep/19

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 2.9.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Prashant Gupta (Inactive) Assignee: Robert Stam
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

.net core



 Description   

WTimout setting in the connection string is interpreted as second instead of milliseconds.  In DOCS it is specified as ms - https://docs.mongodb.com/manual/reference/write-concern/#wtimeout

Either C# Driver docs need to be clarified to instruct wtimeout is in seconds or driver needs to be updated to use millis.

 



 Comments   
Comment by Robert Stam [ 04/Sep/19 ]

The proper link to the documentation for a connection string is:

https://docs.mongodb.com/manual/reference/connection-string/

You should be using wtimeoutMS (note the MS on the end of the name) on the connection string.

The C# driver happens to support wtimeout as an alternative way to specify the wTimeout value. It accepts optional units, and defaults to seconds. For example:

mongodb://localhost/?wtimeout=10ms

 is equivalent to:

mognodb://localhost/?wtimeoutMS=10

Generated at Wed Feb 07 21:43:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.