maxIdleTimeMS implementation does not adhere to the specification

XMLWordPrintableJSON

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

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • 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:
            Boris Dogadov
            Reporter:
            Dmitry Ryabtsev
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: