Remove RPC non-fail-fast return
This commit is contained in:
Родитель
779083c633
Коммит
558ecfb3a6
16
call.go
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче