Skip to content

Commit

Permalink
fix:duplicate copy MD (zeromicro#2304)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsx864321 authored Aug 27, 2022
1 parent 93584c6 commit 05007c8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions zrpc/internal/clientinterceptors/tracinginterceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,8 @@ func (w *clientStream) sendStreamEvent(eventType streamEventType, err error) {
}

func startSpan(ctx context.Context, method, target string) (context.Context, trace.Span) {
var md metadata.MD
requestMetadata, ok := metadata.FromOutgoingContext(ctx)
if ok {
md = requestMetadata.Copy()
} else {
md, ok := metadata.FromOutgoingContext(ctx)
if !ok {
md = metadata.MD{}
}
tr := otel.Tracer(ztrace.TraceName)
Expand Down

0 comments on commit 05007c8

Please sign in to comment.