Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3769

Deprecate unimplemented URI options

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.29.0
    • Affects Version/s: None
    • Component/s: Logging
    • None
    • Fully Compatible
    • Not Needed

      Deprecate the unimplemented URI options MONGOC_URI_MAXIDLETIMEMS and MONGOC_URI_WAITQUEUEMULTIPLE. Log a deprecation warning if used.

      Background

      MONGOC_URI_MAXIDLETIMEMS and MONGOC_URI_WAITQUEUEMULTIPLE are documented as "Not implemented".

      Quoting the Connection String Spec

      A WARN level logging message MUST be issued for unsupported keys

      libmongoc does not warn if a URI contains these options.

      Here is a failing test:

      static void
      test_uri_depr (void)
      {
         // Test an unsupported option warns.
         {
            capture_logs (true);
            mongoc_uri_t *uri = mongoc_uri_new ("mongodb://host/?foo=bar");
            ASSERT_CAPTURED_LOG ("uri", MONGOC_LOG_LEVEL_WARNING, "Unsupported"); // OK.
            capture_logs (false);
            mongoc_uri_destroy (uri);
         }
         // Test maxIdleTimeMS warns (currently fails).
         {
            capture_logs (true);
            mongoc_uri_t *uri = mongoc_uri_new ("mongodb://host/?maxIdleTimeMS=123");
            ASSERT_CAPTURED_LOG ("uri", MONGOC_LOG_LEVEL_WARNING, "Unsupported"); // Fails! Nothing was logged.
            capture_logs (false);
            mongoc_uri_destroy (uri);
         }
      }
      

            Assignee:
            micah.scott@mongodb.com Micah Scott
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: