Remove RPC non-fail-fast return

This commit is contained in:
Menghan Li 2016-07-18 11:58:15 -07:00
Родитель 779083c633
Коммит 558ecfb3a6
2 изменённых файлов: 3 добавлений и 22 удалений

16
call.go
Просмотреть файл

@ -190,13 +190,10 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
// Retry a non-failfast RPC when
// i) there is a connection error; or
// ii) the server started to drain before this RPC was initiated.
if e, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
if _, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
if c.failFast {
return toRPCErr(err)
}
if ok && !e.Temporary() {
return toRPCErr(err)
}
continue
}
return toRPCErr(err)
@ -207,16 +204,7 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
put()
put = nil
}
if e, ok := err.(transport.ConnectionError); ok {
if c.failFast {
return toRPCErr(err)
}
if !e.Temporary() {
return toRPCErr(err)
}
continue
}
if err == transport.ErrStreamDrain {
if _, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
if c.failFast {
return toRPCErr(err)
}

Просмотреть файл

@ -166,14 +166,7 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
put()
put = nil
}
if e, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
if c.failFast || e.Temporary() {
cs.finish(err)
return nil, toRPCErr(err)
}
continue
}
if err == transport.ErrStreamDrain {
if _, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
if c.failFast {
cs.finish(err)
return nil, toRPCErr(err)