-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
RUBY-3429 Retry failed KMS requests #2907
Conversation
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.
Looks good -- just the one question about integer division around the sleep
call.
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? |
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 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?
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, thank you! Fixed.
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.
👍
No description provided.