Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracing: assert against mixing tracers
Creating a child with a different Tracer than the parent is broken because the child span can leak: if the parent is Finish()ed first, the child gets inserted into the parent's registry: https://github.com/cockroachdb/cockroach/blob/d60e17a7047bb16b6aed1585bc5d274bd748d04e/pkg/util/tracing/crdbspan.go#L186 However, when the child gets Finish()ed, we attempt to remove it from its Tracer's registry. Mixing Tracers like this seems fundamentally a bad idea, because it is inherently unclear what the behavior with respect to the registries should be. This patch adds an assertion at span creation time checking that the two Tracers involved are one and the same. Release note: None
- Loading branch information