You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst
+83-11Lines changed: 83 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ Abstract
12
12
13
13
Drivers currently support a variety of options that allow users to configure connection pooling behavior. Users are confused by drivers supporting different subsets of these options. Additionally, drivers implement their connection pools differently, making it difficult to design cross-driver pool functionality. By unifying and codifying pooling options and behavior across all drivers, we will increase user comprehension and code base maintainability.
14
14
15
+
This specification does not apply to drivers that do not support multitasking.
16
+
15
17
META
16
18
====
17
19
@@ -131,8 +133,9 @@ Additionally, Drivers that implement a Connection Pool MUST support the followin
131
133
/**
132
134
* NOTE: This option has been deprecated in favor of timeoutMS.
133
135
*
134
-
* The maximum amount of time a thread can wait for a connection
135
-
* to become available.
136
+
* The maximum amount of time a thread can wait for
137
+
* either an available non-perished connection (limited by `maxPoolSize`),
138
+
* or a pending connection (limited by `maxConnecting`).
136
139
* If specified, MUST be a number >= 0.
137
140
* A value of 0 means there is no limit.
138
141
* Defaults to 0.
@@ -641,12 +644,6 @@ Before a given `Connection <#connection>`_ is returned from checkOut, it must be
641
644
# This must be done in all drivers
642
645
leave wait queue
643
646
644
-
# If there is no background thread, the pool MUST ensure that
645
-
# there are at least minPoolSize total connections.
646
-
# This MUST be done in a non-blocking manner
647
-
while totalConnectionCount < minPoolSize:
648
-
populate the pool with a connection
649
-
650
647
# If the Connection has not been established yet (TCP, TLS,
651
648
# handshake, compression, and auth), it must be established
652
649
# before it is returned.
@@ -663,6 +660,13 @@ Before a given `Connection <#connection>`_ is returned from checkOut, it must be
663
660
else:
664
661
decrement availableConnectionCount
665
662
set connection state to "in use"
663
+
664
+
# If there is no background thread, the pool MUST ensure that
665
+
# there are at least minPoolSize total connections.
666
+
do asynchronously:
667
+
while totalConnectionCount < minPoolSize:
668
+
populate the pool with a connection
669
+
666
670
emit ConnectionCheckedOutEvent and equivalent log message
667
671
return connection
668
672
@@ -909,6 +913,30 @@ See the `Load Balancer Specification <../load-balancers/load-balancers.rst#event
909
913
* The ID of the Connection
910
914
*/
911
915
connectionId:int64;
916
+
917
+
/**
918
+
* The time it took to establish the connection.
919
+
* In accordance with the definition of establishment of a connection
920
+
* specified by `ConnectionPoolOptions.maxConnecting`,
921
+
* it is the time elapsed between the `ConnectionCreatedEvent`
922
+
* emitted by the same checking out and this event.
923
+
*
924
+
* Naturally, when establishing a connection is part of checking out,
0 commit comments