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