Skip to content

Commit

Permalink
DRIVERS-2223 Fix race condition in pool-checkout-returned-connection-…
Browse files Browse the repository at this point in the history
…maxConnecting.yml
  • Loading branch information
matthewdale committed Nov 1, 2024
1 parent 38cbbce commit 5adde93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,8 @@ to close and remove from its pool a [Connection](#connection) which has unread e

## Changelog

- 2024-11-01: Fixed race condition in pool-checkout-returned-connection-maxConnecting.yml test.

- 2024-01-23: Migrated from reStructuredText to Markdown.

- 2019-06-06: Add "connectionError" as a valid reason for ConnectionCheckOutFailedEvent
Expand Down

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
Expand Up @@ -15,6 +15,7 @@ failPoint:
blockConnection: true
blockTimeMS: 750
poolOptions:
maxConnecting: 2
maxPoolSize: 10
waitQueueTimeoutMS: 5000
operations:
Expand Down Expand Up @@ -45,14 +46,10 @@ operations:
count: 4
- name: wait
ms: 100
# check original connection back in, so the thread that isn't
# currently establishing will become unblocked. Then wait for
# all threads to complete.
# Check original connection back in, so one of the waiting threads can check
# out the idle connection before the two new connections are ready.
- name: checkIn
connection: conn0
- name: waitForEvent
event: ConnectionCheckedOut
count: 4
events:
# main thread checking out a Connection and holding it
- type: ConnectionCreated
Expand All @@ -69,15 +66,13 @@ events:
- type: ConnectionCheckedIn
connectionId: 1
address: 42
# remaining thread checking out the returned Connection
# Another thread checks out the returned Connection before the two new
# connections are checked out.
- type: ConnectionCheckedOut
connectionId: 1
address: 42
# first two threads finishing Connection establishment
- type: ConnectionCheckedOut
address: 42
- type: ConnectionCheckedOut
address: 42
# Events after this can come in different orders but still be valid.
# See DRIVERS-2223 for details.
ignore:
- ConnectionPoolReady
- ConnectionClosed
Expand Down

0 comments on commit 5adde93

Please sign in to comment.