Add option for gRPC client connection retries#270
Conversation
eae3e79 to
a8eca23
Compare
lib/temporal/connection/grpc.rb
Outdated
| maxAttempts: 3, | ||
| initialBackoff: "0.1s", | ||
| backoffMultiplier: 2.0, | ||
| maxBackoff: "0.3s" |
There was a problem hiding this comment.
@hughevans thanks for the PR! It looks good overall.
For maxAttempts, initialBackoff, backoffMultiplier, and maxBackoff - I think these are sane defaults, but if we're going to support retries I'd prefer that users be able to pass in their own values to override these if they want. Could you make them configurable?
There was a problem hiding this comment.
@DeRauk Thank you for checking this out. I’ve gone ahead and added a retry_policy option there too.
Also I looked at the README, but was a bit unsure where exactly documentation for this should go logically. Is that something you could take on after merging possibly? 🙇
a8eca23 to
1c29f82
Compare
spec/unit/lib/temporal/grpc_spec.rb
Outdated
| end | ||
|
|
||
| context "when passing a custom retry policy" do | ||
| subject { Temporal::Connection::GRPC.new(nil, nil, identity, :this_channel_is_insecure, retry_policy:) } |
There was a problem hiding this comment.
Ah, sorry that only works in newer versions of Ruby. I have pushed a fix now thanks.
1c29f82 to
5ce5c26
Compare
Add a config option for a basic gRPC connection retry policy:
That uses a basic policy:
There’s also a
retry_policyoption to set a custom policy if you want more control: