Skip to content

Commit 337cad1

Browse files
authored
Default Wait for Ready to false (grpc#6)
## 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.
1 parent ba557f2 commit 337cad1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/GRPCNIOTransportCore/Client/Connection/GRPCChannel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ extension GRPCChannel {
269269
descriptor: MethodDescriptor,
270270
options: CallOptions
271271
) async -> MakeStreamResult {
272-
let waitForReady = options.waitForReady ?? true
272+
let waitForReady = options.waitForReady ?? false
273273
switch self.state.withLock({ $0.makeStream(waitForReady: waitForReady) }) {
274274
case .useLoadBalancer(let loadBalancer):
275275
return await self.makeStream(

0 commit comments

Comments
 (0)