Skip to content

[Spec Resync] 06-01-2026 - #2831

Closed
mongodb-drivers-pr-bot[bot] wants to merge 10 commits into
masterfrom
spec-resync-06-01-2026
Closed

mongodb-drivers-pr-bot[bot] wants to merge 10 commits into
masterfrom
spec-resync-06-01-2026

Conversation

@mongodb-drivers-pr-bot

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Jira tickets: https://jira.mongodb.org/issues/?jql=labels%20%3D%20automated-sync%20AND%20status%20!%3D%20Closed

PYTHON-5812
PYTHON-5720
PYTHON-5533

The following specs were changed:
-connection_monitoring
-load_balancer
-server_selection_logging
-transactions
-transactions-convenient-api

The following spec syncs encountered errors:
-applying patches

'

The following directories are in the specification repository and not in our test directory:
-open_telemetry
-causal_consistency

@mongodb-drivers-pr-bot
mongodb-drivers-pr-bot Bot requested a review from a team as a code owner June 1, 2026 16:01
@sophiayangDB
sophiayangDB requested a review from blink1073 June 1, 2026 16:06
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

blink1073 added 5 commits June 2, 2026 05:42
The server selection spec was updated to expect the "Waiting for suitable
server to become available" log message at INFO level. PyMongo was still
emitting it at DEBUG, causing test_server_selection_logging failures.
Removes the need for the now-deleted PYTHON-4201.patch.
Two spec changes from the 2026-06-01 resync:

1. cursors.json: pinned connections must remain checked out after getMore
   errors in load balancer mode. Don't call close() on OperationFailure or
   ConnectionFailure when _sock_mgr is set; just mark _killed=True and let
   the application release the connection via cursor.close().

2. sdam-error-handling.json: poolClearedEvent must precede
   connectionClosedEvent when auth fails. Call handler.handle() before
   close_conn() in Pool.connect() so SDAM error handling (and the resulting
   pool reset) fires before the connection is closed.
Two root-cause fixes:

1. AsyncCursor._send_message() also needed the pinned-connection guard —
   the test uses NonLazyCursor wrapping AsyncCursor, not AsyncCommandCursor.
   Apply the same _sock_mgr check as the previous commit.

2. Pool.connect(): _raise_connection_failure() was emitting
   connectionClosedEvent for not-ready connections before handler.handle()
   could clear the pool. Fix by always deferring the event in
   _raise_connection_failure() (use close_conn(None)) and emitting it
   explicitly in connect()'s except block, after pool clearing.
For non-cursor-closed OperationFailures during getMore in load balancer
mode, the cursor server-side is still alive. Don't set _killed=True —
leave it False so cursor.close() sends killCursors via the pinned
connection before releasing it. Only ConnectionFailure (where the server
already closed the cursor) should set _killed=True.
@blink1073
blink1073 marked this pull request as draft June 2, 2026 19:26
blink1073 added 4 commits June 2, 2026 14:29
Pool fix: make the poolClearedEvent-before-connectionClosedEvent ordering
conditional on load_balanced so non-LB auth failures keep their original
event order (connectionClosedEvent → connectionCheckOutFailedEvent).

Spec patch PYTHON-5791: retryable-writes, commit, and callback spec tests
now expect readConcern.afterClusterTime in retried write commands, which
PyMongo does not yet send. Add a patch to revert to the old assertions.
The spec patches in .evergreen/spec-patch/ are only applied during spec
resyncs, not regular test runs. The spec file changes must also be reverted
directly on the branch. Fix the patch file to use the forward diff direction
(what was added in the spec) so git apply -R works correctly in future resyncs.
@blink1073 blink1073 closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants