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

Only topology scanner performs MongoDB Handshake

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

      When using a client pool with a uri that has the ?appName=<something> option specified, none of the clients received from the pool will have the name passed to it. This is caused by the following lines 752-757 of mongoc-client.c, duplicated here:

         appname =
            mongoc_uri_get_option_as_utf8 (client->uri, MONGOC_URI_APPNAME, NULL);
         if (appname && client->topology->single_threaded) {
            /* the appname should have already been validated */
            BSON_ASSERT (mongoc_client_set_appname (client, appname));
         }
      

      single_threaded is set to false when using a pool, as set at mongoc-client-pool.c:111.

      This seems like a bug to me, but I could be misunderstanding how pools are meant to interact with the appName. The setting is explicitly excluded for multi-threaded contexts, so maybe this is intended. If it is indeed a bug, it should be fixed.

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: