Skip to content

PYTHON-3017 Properly check for closed KMS connections #790

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

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

ShaneHarvey
Copy link
Member

No description provided.

@@ -129,6 +129,8 @@ def kms_request(self, kms_context):
conn.sendall(message)
while kms_context.bytes_needed > 0:
data = conn.recv(kms_context.bytes_needed)
if not data:
raise OSError('KMS connection closed')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was happening here is that the connection was closed, recv returns b'' and then we get stuck in an infinite loop.

@ShaneHarvey ShaneHarvey merged commit 99aab1b into mongodb:master Nov 16, 2021
@ShaneHarvey ShaneHarvey deleted the PYTHON-3017-fix branch November 16, 2021 22:34
ShaneHarvey added a commit to ShaneHarvey/mongo-python-driver that referenced this pull request Nov 16, 2021
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 5, 2022
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 7, 2022
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