Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
Description
Not sure if this is a big issue or not, but here it is. The spec says that the default value for maxIdleTimeMS should be 0. The C# driver however does not accept 0, but throws an exception instead:
Exception caught Value is not greater than zero: 00:00:00.
|
Parameter name: maxIdleTime
|
Also, maxIdleTimeMS if specified in the URI, translates into maxConnectionLifeTime, but not into maxConnectionIdleTime, which seems confusing:
static String uri = "mongodb://admin:123@mubuntu:27017/test?authSource=admin&minPoolSize=10&maxIdleTimeMS=0";
|
|
|
var mongoUrl = MongoUrl.Create(uri);
|
var settings = MongoClientSettings.FromUrl(mongoUrl);
|
|
|
Console.WriteLine("maxConnectionIdleTime: " + settings.MaxConnectionLifeTime);
|
Console.WriteLine("maxConnectionLifeTime " + settings.MaxConnectionIdleTime);
|
The above code produces:
maxConnectionIdleTime: 00:30:00
|
maxConnectionLifeTime 00:00:00
|