mirror of https://github.com/grpc/grpc-go.git
bug fix: stop busy wait on new transport
This commit is contained in:
parent
86d9dff62d
commit
ec8414396c
3
call.go
3
call.go
|
|
@ -160,9 +160,6 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
}
|
||||
t, err = conn.Wait(ctx)
|
||||
if err != nil {
|
||||
if err == ErrTransientFailure {
|
||||
continue
|
||||
}
|
||||
if lastErr != nil {
|
||||
// This was a retry; return the error from the last attempt.
|
||||
return toRPCErr(lastErr)
|
||||
|
|
|
|||
|
|
@ -65,8 +65,6 @@ var (
|
|||
// ErrClientConnTimeout indicates that the connection could not be
|
||||
// established or re-established within the specified timeout.
|
||||
ErrClientConnTimeout = errors.New("grpc: timed out trying to connect")
|
||||
// ErrTransientFailure indicates the connection failed due to a transient error.
|
||||
ErrTransientFailure = errors.New("grpc: transient connection failure")
|
||||
// minimum time to give a connection to complete
|
||||
minConnectTimeout = 20 * time.Second
|
||||
)
|
||||
|
|
@ -479,11 +477,6 @@ func (cc *Conn) Wait(ctx context.Context) (transport.ClientTransport, error) {
|
|||
case cc.state == Ready:
|
||||
cc.mu.Unlock()
|
||||
return cc.transport, nil
|
||||
case cc.state == TransientFailure:
|
||||
cc.mu.Unlock()
|
||||
// Break out so that the caller gets chance to pick another transport to
|
||||
// perform rpc instead of sticking to this transport.
|
||||
return nil, ErrTransientFailure
|
||||
default:
|
||||
ready := cc.ready
|
||||
if ready == nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue