Skip to content

PYTHON-3519 Fix race condition in pool _reset() causing flaky test - #2848

Merged
blink1073 merged 1 commit into
mongodb:masterfrom
blink1073:PYTHON-3519
Jun 8, 2026
Merged

blink1073 merged 1 commit into
mongodb:masterfrom
blink1073:PYTHON-3519

Conversation

@blink1073

@blink1073 blink1073 commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

PYTHON-3519

Changes in this PR

Fixes a race condition in Pool._reset() that caused test_pool_paused_error_is_retryable to fail intermittently on PyPy and free-threaded Python. Removes the PyPy skip from the test.

Test Plan

Run the standard Evergreen tests.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage? (existing test re-enabled)
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

Publish PoolClearedEvent inside size_cond before notify_all() so that
no waiting thread can emit ConnectionCheckOutFailedEvent before it.
Remove the PyPy skip from test_pool_paused_error_is_retryable.
@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

Copy link
Copy Markdown
Member Author

MacOS Arm64 failures are unrelated and tracked by PYTHON-5861

@blink1073
blink1073 marked this pull request as ready for review June 4, 2026 17:27
@blink1073
blink1073 requested a review from a team as a code owner June 4, 2026 17:27
@blink1073
blink1073 requested a review from NoahStapp June 4, 2026 17:27
@blink1073
blink1073 merged commit 0604126 into mongodb:master Jun 8, 2026
87 of 89 checks passed
@blink1073
blink1073 deleted the PYTHON-3519 branch June 8, 2026 11:26
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.

3 participants