-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5642 - getMore operations should do server selection if the server is unknown #2621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Typing error: Found 2 errors in 1 file (checked 148 source files)
"ServerDescription | None"; expected "ServerDescription" [list-item]
return [description] if description.is_server_type_known e...
^~~~~~~~~~~
pymongo/topology_description.py:325: error: Item "None" of
"ServerDescription | None" has no attribute "is_server_type_known" [union-attr]
return [description] if description.is_server_type_known e...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: Recipe `typing-mypy` failed on line 41 with exit code 1
error: Recipe `typing` failed on line 36 with exit code 1 |
pymongo/topology_description.py
Outdated
| # Ignore selectors when explicit address is requested. | ||
| description = self.server_descriptions().get(address) | ||
| return [description] if description else [] | ||
| return [description] if description.is_server_type_known else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can description be None?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, in theory yes.
blink1073
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| - Removed support for Eventlet. | ||
| Eventlet is actively being sunset by its maintainers and has compatibility issues with PyMongo's dnspython dependency. | ||
| - Use Zstandard support from the standard library for Python 3.14+, and use ``backports.zstd`` for older versions. | ||
| - Fixed a bug that could cause ``AutoReconnect("connection pool paused")`` errors when cursors fetched more documents from the database after SDAM heartbeat failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a 4.15.5 release
|
drivers-pr-bot please backport to v4.15 |
blink1073
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Sorry, unable to cherry-pick to v4.15, please backport manually. Here are approximate instructions:
|
PYTHON-5642
Summary
Currently, cursor getMores against non-standalone, non-loadbalanced servers do not block for server selection, even if the pinned server for the operation is in an unknown state. This can cause the getMore to fail with a
Connection pool pausederror.Changes in this PR
getMore operations now wait for server selection if their pinned server is in an unknown state.
Testing Plan
Added a new test
test_server_selection_getMore_blocks.Screenshots (optional)
Checklist
Checklist for Author
Checklist for Reviewer {@primary_reviewer}