Skip to content

Commit 566aad1

Browse files
authored
examples/retry: remove waitForReady from service config (#7450)
1 parent ec9dff7 commit 566aad1

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

examples/features/retry/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ RetryableStatusCodes: Retry only when receiving these status codes.
4141
"methodConfig": [{
4242
// config per method or all methods under service
4343
"name": [{"service": "grpc.examples.echo.Echo"}],
44-
"waitForReady": true,
4544
4645
"retryPolicy": {
4746
"MaxAttempts": 4,

examples/features/retry/client/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var (
3636
retryPolicy = `{
3737
"methodConfig": [{
3838
"name": [{"service": "grpc.examples.echo.Echo"}],
39-
"waitForReady": true,
4039
"retryPolicy": {
4140
"MaxAttempts": 4,
4241
"InitialBackoff": ".01s",

rpc_util.go

+7-11
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,13 @@ func (o PeerCallOption) after(c *callInfo, attempt *csAttempt) {
271271
}
272272
}
273273

274-
// WaitForReady configures the action to take when an RPC is attempted on broken
275-
// connections or unreachable servers. If waitForReady is false and the
276-
// connection is in the TRANSIENT_FAILURE state, the RPC will fail
277-
// immediately. Otherwise, the RPC client will block the call until a
278-
// connection is available (or the call is canceled or times out) and will
279-
// retry the call if it fails due to a transient error. gRPC will not retry if
280-
// data was written to the wire unless the server indicates it did not process
281-
// the data. Please refer to
282-
// https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md.
283-
//
284-
// By default, RPCs don't "wait for ready".
274+
// WaitForReady configures the RPC's behavior when the client is in
275+
// TRANSIENT_FAILURE, which occurs when all addresses fail to connect. If
276+
// waitForReady is false, the RPC will fail immediately. Otherwise, the client
277+
// will wait until a connection becomes available or the RPC's deadline is
278+
// reached.
279+
//
280+
// By default, RPCs do not "wait for ready".
285281
func WaitForReady(waitForReady bool) CallOption {
286282
return FailFastCallOption{FailFast: !waitForReady}
287283
}

0 commit comments

Comments
 (0)