You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a mismatch in SQLCommentCarrier & textmap propagator about the fact that a span in spanContext can be nil, which leads to panics in code.
In sqlcomment.go the SQLCommentCarrier assumes that a spanContext always has a non-nil span,
func (c *spanContext) meta(key string) (val string, ok bool) {
// will panic if c.span is nil
c.span.RLock()
defer c.span.RUnlock()
val, ok = c.span.Meta[key]
return val, ok
}
func (c *SQLCommentCarrier) Inject(spanCtx ddtrace.SpanContext) error {
.....
case DBMPropagationModeService:
if ctx, ok := spanCtx.(*spanContext); ok {
// calling meta assumes ctx.span to me non-nil
if e, ok := ctx.meta(ext.Environment); ok && e != "" {
tags[sqlCommentEnv] = e
}
In textmap.go the extractor creates a spanContext without an actual span.
Version
latest
Describe what happened:
A spanContext extracted from a textmap propagator that is injected into an SQLCommentCarrier will lead to panic.
Describe what you expected:
Definetly no panic in a tracing library.
Steps to reproduce the issue:
Extract the context using textmap.go
Inject via sqlcomment.go
Additional environment details (Version of Go, Operating System, etc.):
The text was updated successfully, but these errors were encountered:
There is a mismatch in SQLCommentCarrier & textmap propagator about the fact that a span in spanContext can be
nil
, which leads to panics in code.SQLCommentCarrier
assumes that aspanContext
always has a non-nil span,spanContext
without an actual span.Version
latest
Describe what happened:
A spanContext extracted from a textmap propagator that is injected into an SQLCommentCarrier will lead to panic.
Describe what you expected:
Definetly no panic in a tracing library.
Steps to reproduce the issue:
Additional environment details (Version of Go, Operating System, etc.):
The text was updated successfully, but these errors were encountered: