Visitar URL original
PYTHON-6149 Fix condition for minPoolSize validation by MaddipatlaChetan24 · Pull Request #3099 · mongodb/mongo-python-driver · GitHub
Skip to content

PYTHON-6149 Fix condition for minPoolSize validation - #3099

Open
MaddipatlaChetan24 wants to merge 4 commits into
mongodb:mainfrom
MaddipatlaChetan24:patch-1
Open

MaddipatlaChetan24 wants to merge 4 commits into
mongodb:mainfrom
MaddipatlaChetan24:patch-1

Conversation

@MaddipatlaChetan24

@MaddipatlaChetan24 MaddipatlaChetan24 commented Oct 6, 2026 •

Copy link
Copy Markdown

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!

This branch has not been deployed

No deployments
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