-
Notifications
You must be signed in to change notification settings - Fork 246
DRIVERS-3218 Avoid clearing the connection pool when the server connection rate limiter triggers #1855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
DRIVERS-3218 Avoid clearing the connection pool when the server connection rate limiter triggers #1855
Changes from 1 commit
5ad9007
5536501
199c4d7
aa08fe9
7d32469
4d318fa
2c87677
f46d39c
a14cacc
fdcacbd
53a7fdf
2a287dc
c8d1a33
f4106e8
bdde73f
99948d7
3779d26
94a082e
659133f
9dedf63
b70d360
00e54b0
6bd9f70
9b9c4af
da3885a
7464e61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,6 +284,13 @@ Endpoint. The pool has the following properties: | |
| - **Rate-limited:** A Pool MUST limit the number of [Connections](#connection) being | ||
| [established](#establishing-a-connection-internal-implementation) concurrently via the **maxConnecting** | ||
| [pool option](#connection-pool-options). | ||
| - **Backpressure-enabled** - The pool MUST add the error labels `SystemOverloadedError` and `RetryableError` to network | ||
| errors or network timeouts it encounters during the TLS Handshake or the `hello` message. These labels are used by | ||
| the [server monitor](../server-discovery-and-monitoring/server-discovery-and-monitoring.md#error-handling-pseudocode) | ||
| to avoid clearing the pool. The pool MUST not add the backpressure error labels during an authentication step | ||
| after the `hello` message. If the driver cannot distinguish between TLS Handshake and TCP connection or DNS lookup, | ||
| it MUST add the backpressure error labels to network errors or network timeouts during initial connection | ||
| establishment. | ||
|
|
||
| ```typescript | ||
| interface ConnectionPool { | ||
|
|
@@ -1375,6 +1382,8 @@ to close and remove from its pool a [Connection](#connection) which has unread e | |
|
|
||
| ## Changelog | ||
|
|
||
| - 2025-XX-YY: Add handling of backpressure error labels. | ||
|
||
|
|
||
| - 2025-01-22: Clarify durationMS in logs may be Int32/Int64/Double. | ||
|
|
||
| - 2024-11-27: Relaxed the WaitQueue fairness requirement. | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,14 @@ failPoint: | |
| mode: { times: 50 } | ||
| data: | ||
| failCommands: ["isMaster","hello"] | ||
| closeConnection: true | ||
| blockConnection: true | ||
|
||
| blockTimeMS: 1000 | ||
| appName: "poolCreateMinSizeErrorTest" | ||
| poolOptions: | ||
| minPoolSize: 1 | ||
| backgroundThreadIntervalMS: 50 | ||
| socketTimeoutMS: 500 | ||
| connectTimeoutMS: 500 | ||
| appName: "poolCreateMinSizeErrorTest" | ||
| operations: | ||
| - name: ready | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| description: backpressure-network-error-fail | ||
| schemaVersion: "1.4" | ||
| runOnRequirements: | ||
| - minServerVersion: "4.4" | ||
| serverless: forbid | ||
| topologies: | ||
| - single | ||
| - replicaset | ||
| - sharded | ||
| createEntities: | ||
| - client: | ||
| id: setupClient | ||
| useMultipleMongoses: false | ||
| initialData: | ||
| - collectionName: backpressure-network-error-fail | ||
| databaseName: sdam-tests | ||
| documents: | ||
| - _id: 1 | ||
| - _id: 2 | ||
| tests: | ||
| - description: Apply backpressure on network connection errors during connection establishment | ||
| operations: | ||
| - name: createEntities | ||
baileympearson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| object: testRunner | ||
| arguments: | ||
| entities: | ||
| - client: | ||
| id: client | ||
| useMultipleMongoses: false | ||
| observeEvents: | ||
| - serverHeartbeatSucceededEvent | ||
| - poolReadyEvent | ||
| - poolClearedEvent | ||
| uriOptions: | ||
| retryWrites: false | ||
| heartbeatFrequencyMS: 10000 | ||
| serverMonitoringMode: poll | ||
| directConnection: true | ||
| appname: backpressureNetworkErrorFailTest | ||
| - database: | ||
| id: database | ||
| client: client | ||
| databaseName: sdam-tests | ||
| - collection: | ||
| id: collection | ||
| database: database | ||
| collectionName: backpressure-network-error-fail | ||
| - name: waitForEvent | ||
| object: testRunner | ||
| arguments: | ||
| client: client | ||
| event: | ||
| serverHeartbeatSucceededEvent: {} | ||
| count: 1 | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: setupClient | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: alwaysOn | ||
| data: | ||
| failCommands: | ||
| - isMaster | ||
| - hello | ||
| appName: backpressureNetworkErrorFailTest | ||
| closeConnection: true | ||
baileympearson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: insertMany | ||
| object: collection | ||
| arguments: | ||
| documents: | ||
| - _id: 3 | ||
| - _id: 4 | ||
| expectError: | ||
| isError: true | ||
| errorLabelsContain: | ||
| - SystemOverloadedError | ||
| - RetryableError | ||
| expectEvents: | ||
| - client: client | ||
| eventType: cmap | ||
| events: | ||
| - poolReadyEvent: {} | ||
Uh oh!
There was an error while loading. Please reload this page.