Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ae45464
PYTHON-5517 Updates to connection pool backoff
blink1073 Oct 22, 2025
a4dd0f1
wip add tests
blink1073 Oct 23, 2025
25ab418
update tests
blink1073 Oct 23, 2025
58602c7
update sdam tests
blink1073 Oct 24, 2025
d3a4958
wip update tests
blink1073 Oct 24, 2025
1895e00
Merge branch 'backpressure' of github.com:mongodb/mongo-python-driver…
blink1073 Oct 24, 2025
76c4ee6
Revert "Merge branch 'backpressure' of github.com:mongodb/mongo-pytho…
blink1073 Oct 24, 2025
546976d
Revert "wip update tests"
blink1073 Oct 24, 2025
e52ecdf
wip update tests
blink1073 Oct 24, 2025
5ef7656
update to branch
blink1073 Oct 24, 2025
6d8369f
wip
blink1073 Oct 24, 2025
24542c9
fix backoff logic
blink1073 Oct 24, 2025
5e64aa9
fix race condition
blink1073 Oct 24, 2025
f67195e
update to use durationms
blink1073 Oct 24, 2025
873d1f1
add test that transitions from backoff to clear
blink1073 Oct 24, 2025
02aec91
clean up the tests
blink1073 Oct 24, 2025
73ff3d6
update logging test
blink1073 Oct 24, 2025
c70b66c
fix typing
blink1073 Oct 24, 2025
f20cc0a
add final test
blink1073 Oct 25, 2025
e905b9b
fix ready condition
blink1073 Oct 25, 2025
d228f08
wip incorporate design changes
blink1073 Oct 27, 2025
73e78b6
update tests
blink1073 Oct 28, 2025
adc1375
PYTHON-5627 - Update feedback link (#2601)
NoahStapp Oct 24, 2025
d6d43e7
fix tests
blink1073 Oct 28, 2025
36d4490
fix tests
blink1073 Oct 28, 2025
f936b1b
update backoff logic and fix test
blink1073 Oct 28, 2025
714bc31
fix test
blink1073 Oct 28, 2025
2748749
address failure
blink1073 Oct 28, 2025
2c3c9ad
revert changes to lb test
blink1073 Oct 28, 2025
84f3b68
more test cleanup
blink1073 Oct 28, 2025
ca6c981
more test cleanup
blink1073 Oct 28, 2025
94bc9a3
fix load balancer test
blink1073 Oct 28, 2025
85d2a6b
fix load balancer test
blink1073 Oct 28, 2025
c75ea23
clean up tests
blink1073 Oct 29, 2025
b2b4507
try pypy 3.11
blink1073 Oct 29, 2025
7411be6
add logic for multiple pending connections
blink1073 Oct 29, 2025
c2c8d40
fix race condition in tests
blink1073 Oct 29, 2025
d0aa7c7
undo change to flaky condition
blink1073 Oct 29, 2025
65eb2dc
fix test format
blink1073 Oct 30, 2025
063238d
update schema version
blink1073 Oct 30, 2025
0e9c29a
formatting
blink1073 Oct 30, 2025
a2aec86
update tests
blink1073 Oct 30, 2025
fd63597
fix supported schema version
blink1073 Oct 30, 2025
09647f0
address review
blink1073 Oct 31, 2025
1e6973b
add error label check and add runOnRequirement
blink1073 Oct 31, 2025
d72f279
update retry behavior and tests
blink1073 Nov 3, 2025
476c373
add connection-logging-pool-backoff tests
blink1073 Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update logging test
  • Loading branch information
blink1073 committed Oct 24, 2025
commit 73ff3d6b21f32b718a1cf30bdd311b03f6dce9f3
3 changes: 2 additions & 1 deletion pymongo/asynchronous/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,11 @@ def backoff(self):
if self.enabled_for_logging and _CONNECTION_LOGGER.isEnabledFor(logging.DEBUG):
_debug_log(
_CONNECTION_LOGGER,
message=_ConnectionStatusMessage.POOL_BACKOFF % backoff_duration_ms,
message=_ConnectionStatusMessage.POOL_BACKOFF,
clientId=self._client_id,
serverHost=self.address[0],
serverPort=self.address[1],
durationMS=backoff_duration_ms,
reason=_verbose_connection_error_reason(ConnectionClosedReason.POOL_BACKOFF),
error=ConnectionClosedReason.POOL_BACKOFF,
)
Expand Down
2 changes: 1 addition & 1 deletion pymongo/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class _ConnectionStatusMessage(str, enum.Enum):
POOL_READY = "Connection pool ready"
POOL_CLOSED = "Connection pool closed"
POOL_CLEARED = "Connection pool cleared"
POOL_BACKOFF = "Connection pool backoff %sms"
POOL_BACKOFF = "Connection pool backoff"

CONN_CREATED = "Connection created"
CONN_READY = "Connection ready"
Expand Down
3 changes: 2 additions & 1 deletion pymongo/synchronous/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,10 +1057,11 @@ def backoff(self):
if self.enabled_for_logging and _CONNECTION_LOGGER.isEnabledFor(logging.DEBUG):
_debug_log(
_CONNECTION_LOGGER,
message=_ConnectionStatusMessage.POOL_BACKOFF % backoff_duration_ms,
message=_ConnectionStatusMessage.POOL_BACKOFF,
clientId=self._client_id,
serverHost=self.address[0],
serverPort=self.address[1],
durationMS=backoff_duration_ms,
reason=_verbose_connection_error_reason(ConnectionClosedReason.POOL_BACKOFF),
error=ConnectionClosedReason.POOL_BACKOFF,
)
Expand Down
5 changes: 4 additions & 1 deletion test/connection_logging/connection-logging.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,13 @@
"level": "debug",
"component": "connection",
"data": {
"message": "Connection pool backoff attempt number 1",
"message": "Connection pool backoff",
"serverHost": {
"$$type": "string"
},
"durationMS": {
"$$type": "int"
},
"serverPort": {
"$$type": [
"int",
Expand Down
Loading