Explorar el Código

Default Wait for Ready to false (#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.
Gus Cairo hace 1 año
padre
commit
337cad13f3

+ 1 - 1
Sources/GRPCNIOTransportCore/Client/Connection/GRPCChannel.swift

@@ -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(