From 59c74732bb3461b45386cead7b76cf789940a558 Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Thu, 14 Jan 2016 14:38:45 -0800 Subject: [PATCH] Don't trace when failing to create a cleint stream --- stream.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stream.go b/stream.go index 537d4b3bc..698d74942 100644 --- a/stream.go +++ b/stream.go @@ -114,6 +114,10 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth codec: cc.dopts.codec, tracing: EnableTracing, } + s, err := t.NewStream(ctx, callHdr) + if err != nil { + return nil, toRPCErr(err) + } if cs.tracing { cs.trInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method) cs.trInfo.firstLine.client = true @@ -123,10 +127,6 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth cs.trInfo.tr.LazyLog(&cs.trInfo.firstLine, false) ctx = trace.NewContext(ctx, cs.trInfo.tr) } - s, err := t.NewStream(ctx, callHdr) - if err != nil { - return nil, toRPCErr(err) - } cs.t = t cs.s = s cs.p = &parser{s: s}