Still show trace for the client streams which failed to create
diff --git a/stream.go b/stream.go
index 698d749..3ac5f6a 100644
--- a/stream.go
+++ b/stream.go
@@ -114,10 +114,6 @@
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
@@ -127,6 +123,11 @@
cs.trInfo.tr.LazyLog(&cs.trInfo.firstLine, false)
ctx = trace.NewContext(ctx, cs.trInfo.tr)
}
+ s, err := t.NewStream(ctx, callHdr)
+ if err != nil {
+ cs.finish(err)
+ return nil, toRPCErr(err)
+ }
cs.t = t
cs.s = s
cs.p = &parser{s: s}