Skip to content

Commit

Permalink
Default Wait for Ready to false (#6)
Browse files Browse the repository at this point in the history
## Motivation
The gRPC docs state that, when a transient failure is encountered, RPCs
should fail immediately by default, without waiting for ready
(https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md).
However, we currently default `waitForReady` to true, meaning that RPCs
may hang in cases such as when the TLS handshake fails or there are
other issues when setting up the connection.

## Modifications
Change the `waitForReady` default to `false`. 

## Result
We now more closely stick to gRPC's specification's advise.
  • Loading branch information
gjcairo authored Sep 25, 2024
1 parent ba557f2 commit 337cad1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ extension GRPCChannel {
descriptor: MethodDescriptor,
options: CallOptions
) async -> MakeStreamResult {
let waitForReady = options.waitForReady ?? true
let waitForReady = options.waitForReady ?? false
switch self.state.withLock({ $0.makeStream(waitForReady: waitForReady) }) {
case .useLoadBalancer(let loadBalancer):
return await self.makeStream(
Expand Down

0 comments on commit 337cad1

Please sign in to comment.