Skip to content

Commit

Permalink
Use span read lock when reading span meta from span context (#1437)
Browse files Browse the repository at this point in the history
* Use span read lock when reading span meta from span context

* Fix typo un mutex unlock call

Co-authored-by: Andrew Glaude <andrew.glaude@datadoghq.com>
  • Loading branch information
alexandre-normand and ajgajg1134 committed Aug 23, 2022
1 parent acd5c8b commit 2bc6d1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ddtrace/tracer/spancontext.go
Expand Up @@ -126,8 +126,8 @@ func (c *spanContext) baggageItem(key string) string {
}

func (c *spanContext) meta(key string) (val string, ok bool) {
c.mu.RLock()
defer c.mu.RUnlock()
c.span.RLock()
defer c.span.RUnlock()
val, ok = c.span.Meta[key]
return val, ok
}
Expand Down

0 comments on commit 2bc6d1b

Please sign in to comment.