bug fix: stop busy wait on new transport

This commit is contained in:
iamqizhao 2015-10-08 09:09:06 -07:00
parent 86d9dff62d
commit ec8414396c
3 changed files with 0 additions and 13 deletions

View File

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

View File

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

View File

@ -108,9 +108,6 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
}
t, err = conn.Wait(ctx)
if err != nil {
if err == ErrTransientFailure {
continue
}
return nil, toRPCErr(err)
}
break