Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2868

maxIdleTimeMS implementation does not adhere to the specification

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Connectivity
    • Labels:
      None

      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
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: