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

_mongoc_client_set_apm_callbacks_private not called for mongoc_client_pool_try_pop

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.14.0
    • Affects Version/s: None
    • Component/s: libmongoc
    • Labels:
      None
    • Minor Change

      https://github.com/mongodb/mongo-c-driver/blob/1.13.0/src/libmongoc/src/mongoc/mongoc-client-pool.c#L212-L235

      mongoc_client_pool_pop (mongoc_client_pool_t *pool)
      {
         mongoc_client_t *client;
      
         ENTRY;
      
         BSON_ASSERT (pool);
      
         bson_mutex_lock (&pool->mutex);
      
      again:
         if (!(client = (mongoc_client_t *) _mongoc_queue_pop_head (&pool->queue))) {
            if (pool->size < pool->max_pool_size) {
               client = _mongoc_client_new_from_uri (pool->topology);
      
               /* for tests */
               mongoc_client_set_stream_initiator (
                  client,
                  pool->topology->scanner->initiator,
                  pool->topology->scanner->initiator_context);
      
               client->error_api_version = pool->error_api_version;
               _mongoc_client_set_apm_callbacks_private (
                  client, &pool->apm_callbacks, pool->apm_context);
      

      The above code is missing in mongoc_client_pool_try_pop: https://github.com/mongodb/mongo-c-driver/blob/1.13.0/src/libmongoc/src/mongoc/mongoc-client-pool.c#L256-L268

      It seems to have been missed by: https://github.com/mongodb/mongo-c-driver/commit/e0eed4a2d1d72d99213db049488703b79a379e94

            Assignee:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Reporter:
            jason.chan@mongodb.com Jason Chan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: