Skip to content

Commit cfe5b5b

Browse files
authored
DRIVERS-1631 Clarify minPoolSize requirement (#1072)
1 parent 0fc8e57 commit cfe5b5b

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -507,16 +507,21 @@ Populating the Pool with a Connection (Internal Implementation)
507507

508508
"Populating" the pool involves preemptively creating and establishing a
509509
`Connection <#connection>`_ which is marked as "available" for use in future
510-
operations. This process is used to help ensure the number of established
511-
connections managed by the pool is at least minPoolSize.
510+
operations.
512511

513512
Populating the pool MUST NOT block any application threads. For example, it
514513
could be performed on a background thread or via the use of non-blocking/async
515514
I/O. Populating the pool MUST NOT be performed unless the pool is "ready".
516515

517-
If an error is encountered while populating a connection, it MUST be handled
518-
via the SDAM machinery according to the `Application Errors`_ section in the
519-
SDAM specification.
516+
If an error is encountered while populating a connection, it MUST be handled via
517+
the SDAM machinery according to the `Application Errors`_ section in the SDAM
518+
specification.
519+
520+
If minPoolSize is set, the `Connection <#connection>`_ Pool MUST be populated
521+
until it has at least minPoolSize total `Connections <#connection>`_. This MUST
522+
occur only while the pool is "ready". If the pool implements a background
523+
thread, it can be used for this. If the pool does not implement a background
524+
thread, the checkOut method is responsible for ensuring this requirement is met.
520525

521526
.. code::
522527
@@ -567,12 +572,10 @@ If the pool is "closed" or "paused", any attempt to check out a `Connection
567572
being "paused" MUST be considered a retryable error and MUST NOT be an error
568573
that marks the SDAM state unknown.
569574

570-
If minPoolSize is set, the `Connection <#connection>`_ Pool MUST have at least
571-
minPoolSize total `Connections <#connection>`_ while it is "ready". If the pool does
572-
not implement a background thread, the checkOut method is responsible for
573-
`populating the pool
574-
<#populating-the-pool-with-a-connection-internal-implementation>`_ with enough
575-
`Connections <#connection>`_ such that this requirement is met.
575+
If the pool does not implement a background thread, the checkOut method is
576+
responsible for ensuring that the pool is `populated
577+
<#populating-the-pool-with-a-connection-internal-implementation>`_ with at least minPoolSize
578+
`Connections <#connection>`_.
576579

577580
A `Connection <#connection>`_ MUST NOT be checked out until it is
578581
established. In addition, the Pool MUST NOT prevent other threads from checking

0 commit comments

Comments
 (0)