Remove RPC non-fail-fast return
This commit is contained in:
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
|
// Retry a non-failfast RPC when
|
||||||
// i) there is a connection error; or
|
// i) there is a connection error; or
|
||||||
// ii) the server started to drain before this RPC was initiated.
|
// 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 {
|
if c.failFast {
|
||||||
return toRPCErr(err)
|
return toRPCErr(err)
|
||||||
}
|
}
|
||||||
if ok && !e.Temporary() {
|
|
||||||
return toRPCErr(err)
|
|
||||||
}
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return toRPCErr(err)
|
return toRPCErr(err)
|
||||||
@ -207,16 +204,7 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||||||
put()
|
put()
|
||||||
put = nil
|
put = nil
|
||||||
}
|
}
|
||||||
if e, ok := err.(transport.ConnectionError); ok {
|
if _, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
|
||||||
if c.failFast {
|
|
||||||
return toRPCErr(err)
|
|
||||||
}
|
|
||||||
if !e.Temporary() {
|
|
||||||
return toRPCErr(err)
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err == transport.ErrStreamDrain {
|
|
||||||
if c.failFast {
|
if c.failFast {
|
||||||
return toRPCErr(err)
|
return toRPCErr(err)
|
||||||
}
|
}
|
||||||
|
@ -166,14 +166,7 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
|
|||||||
put()
|
put()
|
||||||
put = nil
|
put = nil
|
||||||
}
|
}
|
||||||
if e, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
|
if _, 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 c.failFast {
|
if c.failFast {
|
||||||
cs.finish(err)
|
cs.finish(err)
|
||||||
return nil, toRPCErr(err)
|
return nil, toRPCErr(err)
|
||||||
|
Reference in New Issue
Block a user