Skip to content
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

PYTHON-2560 Retry KMS requests on transient errors #2024

Merged
merged 9 commits into from
Dec 4, 2024

Conversation

@ShaneHarvey ShaneHarvey requested a review from blink1073 December 3, 2024 02:56
@blink1073
Copy link
Member

Failures look relevant: "FAILURE: AssertionError: "kms.us-east-1.amazonaws.com:12345" does not match "KMS request failed after 3 retries due to a network error" ()"

@ShaneHarvey
Copy link
Member Author

Ah this is caused by the problem described in: https://jira.mongodb.org/browse/MONGOCRYPT-752

With this new feature, the user gets a too vague error message that just says "KMS request failed after 3 retries due to a network error" so we can't assert on the error message for those other tests now. Without libmongocrypt changes, we'll need to introduce a new context object to store the previous exception error message.

@ShaneHarvey
Copy link
Member Author

It turns out to be quite simple to include the last error message. I didn't realize the error comes from mongocrypt_kms_ctx_fail. Tests are passing locally now.

@blink1073
Copy link
Member

test.test_encryption.TestCustomEndpoint.test_04_aws_endpoint_invalid_port is still failing with:

[2024/12/03 16:50:30.134] FAILURE: AssertionError: "kms.us-east-1.amazonaws.com:12345" does not match "KMS request failed after 3 retries due to a network error, last attempt failed with: [Errno 111] Connection refused" ()

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ShaneHarvey ShaneHarvey merged commit ff2f959 into mongodb:master Dec 4, 2024
37 of 41 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.

2 participants