-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DRIVERS-3218 Avoid clearing the connection pool when the server connection rate limiter triggers #2509
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
base: backpressure
Are you sure you want to change the base?
Conversation
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…b#2507) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ction rate limiter triggers
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <steve.silvester@mongodb.com>
pymongo/asynchronous/pool.py
Outdated
conn.conn.get_conn.read(1) | ||
except Exception as _: | ||
# TODO: verify the exception | ||
close_conn = False |
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.
2 comments:
- I believe this logic needs to move to connection checkout. Here in connection check in we already know the connection is useable because we're checking it back in after a successful command.
- Instead of a 1ms read can we reuse the existing _perished() + conn_closed() methods?
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.
Done
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.
Nice work!
(cherry picked from commit 0d4c84e)
Current status:
Next steps:
|
Encryption failure is unrelated: https://jira.mongodb.org/browse/PYTHON-5521 |
…MiB error codes (mongodb#2515) (cherry picked from commit c0e0554)
This reverts commit 532c1b8.
Currently testing with this script: