-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Logging
-
None
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); } }
- has to be done before
-
CDRIVER-5731 Remove unimplemented URI options
- Backlog