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

Do not start background monitoring when topology is invalid

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.19.1
    • Affects Version/s: None
    • Component/s: None

      Summary
      A mongoc_client_pool_t created with a mongoc_uri_t containing loadBalanced=true and an invalid URI option results in an assertion upon first use.

      To reproduce
      The loadBalanced-replicaSet-errors specification test currently fails due to this bug.

      To run it locally, start a local sharded cluster with TLS configured and two mongos processes on 27017 and 27018.

      Run the test with:

      $ export SINGLE_MONGOS_LB_URI="mongodb://localhost:27017"
      $ export MULTI_MONGOS_LB_URI="mongodb://localhost:27017,localhost:27018"
      $ export MONGOC_TEST_LOADBALANCED=ON
      $ export MONGOC_TEST_SSL=ON
      $ export MONGOC_TEST_SSL_CA_FILE=~/code/mongo-c-driver/src/libmongoc/tests/x509gen/ca.pem
      $ export MONGOC_TEST_DNS_LOADBALANCED=ON
      $ ./cmake-build/src/libmongoc/test-libmongoc -l "/initial_dns_seedlist_discovery/load-balanced/loadBalanced-replicaSet-errors"
      ...
      Begin /initial_dns_seedlist_discovery/load-balanced/loadBalanced-replicaSet-errors, seed 3463113918
      ../src/libmongoc/src/mongoc/mongoc-topology-description-apm.c:130 _mongoc_topology_description_monitor_opening(): precondition failed: td->servers->items_len == 1
      

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: