Skip to content

PYTHON-6149 Fix condition for minPoolSize validation - #3099

Merged
aclark4life merged 11 commits into
mongodb:mainfrom
MaddipatlaChetan24:patch-1
Oct 16, 2026
Merged

aclark4life merged 11 commits into
mongodb:mainfrom
MaddipatlaChetan24:patch-1

Conversation

@MaddipatlaChetan24

@MaddipatlaChetan24 MaddipatlaChetan24 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

PYTHON-6149

Changes in this PR

  • _parse_pool_options only exempted maxPoolSize=None from the minPoolSize <= maxPoolSize check. The docs say both 0 and None mean no limit, and the pool treats both as unlimited. This made MongoClient(maxPoolSize=0, minPoolSize=5) raise ValueError while maxPoolSize=None was accepted.
  • The check now skips both 0 and None.

Test Plan

  • Manual check on PyMongo 4.18.2:
    • maxPoolSize=0 and maxPoolSize=None, each with minPoolSize=5: accepted.
    • maxPoolSize=10, minPoolSize=20, and minPoolSize=200 against the default max of 100: still raise ValueError.
    • maxPoolSize=10, minPoolSize=10: still accepted.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is the intention of the code captured in relevant tests?
  • If there are new TODOs, has a related JIRA ticket been created?

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?)
  • Have you checked for spelling & grammar errors?
  • Is all relevant documentation (README or docstring) updated?

@MaddipatlaChetan24
MaddipatlaChetan24 requested a review from a team as a code owner October 6, 2026 12:18
@aclark4life aclark4life changed the title Fix condition for minPoolSize validation PYTHON-6149 Fix condition for minPoolSize validation Oct 6, 2026
@aclark4life

Copy link
Copy Markdown
Contributor

Thanks @MaddipatlaChetan24 ! Can you please add a test and changelog entry?

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pymongo/client_options.py 0.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@codeowners-service-app

Copy link
Copy Markdown

Assigned caseyclements for team dbx-python because aclark4life is out of office.

@evergreen-ci-prod

Copy link
Copy Markdown

There is an existing patch(es) for this commit SHA:

Please note that the status that is posted is not in the context of this PR but rather the (latest) existing patch and that may affect some tests that may depend on the particular PR. If your tests do not rely on any PR-specific values (like base or head branch name) then your tests will report the same status. If you would like a patch to run in the context of this PR and abort the other(s), comment 'evergreen retry'.

aclark4life
aclark4life previously approved these changes Oct 16, 2026
@aclark4life
aclark4life merged commit df8f10b into mongodb:main Oct 16, 2026
64 of 65 checks passed
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