Skip to content

Commit

Permalink
examples/retry: remove waitForReady from service config (#7450)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley authored Jul 29, 2024
1 parent ec9dff7 commit 566aad1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion examples/features/retry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ RetryableStatusCodes: Retry only when receiving these status codes.
"methodConfig": [{
// config per method or all methods under service
"name": [{"service": "grpc.examples.echo.Echo"}],
"waitForReady": true,
"retryPolicy": {
"MaxAttempts": 4,
Expand Down
1 change: 0 additions & 1 deletion examples/features/retry/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var (
retryPolicy = `{
"methodConfig": [{
"name": [{"service": "grpc.examples.echo.Echo"}],
"waitForReady": true,
"retryPolicy": {
"MaxAttempts": 4,
"InitialBackoff": ".01s",
Expand Down
18 changes: 7 additions & 11 deletions rpc_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,13 @@ func (o PeerCallOption) after(c *callInfo, attempt *csAttempt) {
}
}

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

0 comments on commit 566aad1

Please sign in to comment.