[CDRIVER-2131] mongoc_client_pool_push should mention the configurable uri options Created: 19/Apr/17  Updated: 28/Oct/23  Resolved: 29/Jan/18

Status: Closed
Project: C Driver
Component/s: docs, libmongoc
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2390 Remove minPoolSize option Backlog
is related to CDRIVER-2389 Deprecate minPoolSize and log a warni... Closed

 Description   

The mongoc_client_pool_push docs should say that the client is destroyed if it exceeds the uri configured min_pool_size.

the pop function should also say when a new client is created and how that is configured.

the connection string docs for those values may also need improvements to restate how it works as it isn't identical with other implementations as pointed out by david.golden

The way that's written sounds more like a "maximum number of idle connections in the pool" which isn't how I usually understand minpoolsize

Contrast with pymongo: https://api.mongodb.com/python/current/faq.html#how-does-connection-pooling-work-in-pymongo



 Comments   
Comment by Githook User [ 29/Jan/18 ]

Author:

{'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}

Message: CDRIVER-2131 improve mongoc_client_pool_push doc
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/eab340d4ad2bc56e472fde2d39e74338cfe0f0d1

Comment by David Golden [ 19/Apr/17 ]

Also, the discontinuity of "0" and "1" in minPoolSize is strange. There is no way to configure the pool to destroy all clients if all are returned.

If I understand this correctly, then minPoolSize of "0" is effectively the same as setting minPoolSize = maxPoolSize (i.e. create up to maxPoolSize clients and then never destroy any).

Comment by David Golden [ 19/Apr/17 ]

I think the behavior of mongoc_client_pool_push might be incorrect, or rather that the C driver's interpretation of minPoolSize design intent is incorrect. Maybe this ticket should be re-titled to be a fix for minPoolSize.

I think the current behavior is equivalent to this:

If minPoolSize is set, then after minPoolSize clients are in use, further clients are created on demand up to maxPoolSize and destroyed on return to the pool rather than being kept available for the next request.

Does libmongoc create minPoolSize idle clients when the pool is created? If not, isn't the "min" on "minPoolSize" misleading?

Generated at Wed Feb 07 21:14:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.