maxIdleTimeMS implementation does not adhere to the specification

XMLWordPrintableJSON

    • None
    • Fully Compatible
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • 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:
            Kyra Ramesh Krishna
            Reporter:
            Dmitry Ryabtsev
            None
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: