diff --git a/call.go b/call.go index f1a40a37..0f34b5e8 100644 --- a/call.go +++ b/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) } diff --git a/stream.go b/stream.go index 1d5104f6..66bfad81 100644 --- a/stream.go +++ b/stream.go @@ -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)