Skip to content

RUBY-3429 Retry failed KMS requests - #2907

Merged
comandeo-mongo merged 6 commits into
mongodb:masterfrom
comandeo-mongo:3429-retry-kms
Nov 19, 2024
Merged

RUBY-3429 Retry failed KMS requests#2907
comandeo-mongo merged 6 commits into
mongodb:masterfrom
comandeo-mongo:3429-retry-kms

Conversation

@comandeo-mongo

Copy link
Copy Markdown
Contributor

No description provided.

@comandeo-mongo
comandeo-mongo requested a review from jamis November 18, 2024 09:16

@jamis jamis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good -- just the one question about integer division around the sleep call.

Comment thread lib/mongo/crypt/context.rb Outdated
while (kms_context = Binding.ctx_next_kms_ctx(self)) do
begin
delay = Binding.kms_ctx_usleep(kms_context)
sleep(delay / 1_000_000) unless delay.nil?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think either delay or 1_000_000 needs to be a float here, otherwise it will use integer division. Unless the intention here is to use integer division?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thank you! Fixed.

@comandeo-mongo
comandeo-mongo requested a review from jamis November 19, 2024 11:29

@jamis jamis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@comandeo-mongo
comandeo-mongo merged commit f1d1f91 into mongodb:master Nov 19, 2024
@comandeo-mongo
comandeo-mongo deleted the 3429-retry-kms branch November 19, 2024 15:19
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