Skip to content

tracing: avoid data races w.r.t noopSpan#55937

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
tbg:fix-trace-race
Oct 24, 2020
Merged

tracing: avoid data races w.r.t noopSpan#55937
craig[bot] merged 2 commits intocockroachdb:masterfrom
tbg:fix-trace-race

Conversation

@tbg
Copy link
Copy Markdown
Member

@tbg tbg commented Oct 24, 2020

We were not properly turning all operations on noopSpan into noops.
There is still a lot left to clean up here. Ultimately I want noop spans
to be nil pointers, but that means moving the tracer off first, and this
in turn means moving off the opentracing interfaces.

Touches #50032

Closes #55911,
Closes #55912,
Closes #55913,
Closes #55914,
Closes #55917,
Closes #55918,
Closes #55919, and
Closes #55936.

Release note: None

We were not properly turning all operations on noopSpan into noops.
There is still a lot left to clean up here. Ultimately I want noop spans
to be nil pointers, but that means moving the tracer off first, and this
in turn means moving off the opentracing interfaces.

Fixes cockroachdb#50032.

Release note: None
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

}
}

// Set initial tags.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This movement was necessary to fix a bug: we were linking the shadow span after adding baggage to the parent, so the shadow span never received them. Erroneously passed before my other fixes here.

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Oct 24, 2020

I got through a few race iterations of #50032 without issues locally. Will leave it running for a bit and merge on green since the bug this fixes is quite destabilizing.

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Oct 24, 2020

There's a test failure that I will look into tonight.

…ptor

Skipping this temporarily so I can unscrew tracing.

Release note: None
@rytaft
Copy link
Copy Markdown
Collaborator

rytaft commented Oct 24, 2020

Not sure if this should close #50032, since there was an unrelated failure there before. But I do think it should should close #55911, #55912, #55913, #55914, #55917, #55918, #55919, and #55936.

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Oct 24, 2020

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 24, 2020

Build succeeded:

@craig craig bot merged commit 7fa301f into cockroachdb:master Oct 24, 2020
tbg added a commit to tbg/cockroach that referenced this pull request Oct 27, 2020
We were previously shoehorning our tracing subsystem into the
opentracing framework. This resulted in lots of bending over
backwards to no real gain.

Move off the interfaces so that we can more easily refactor
the code for always-on tracing as well as make it more digestible.

This commit is mostly mechanical. A bunch of code around the
RPC interceptors was cribbed from the `otgrpc` package.

Cleanups are delegated to additional commits.

TestFollowerReadsWithStaleDescriptor, skipped temporarily in cockroachdb#55937,
passes again due to the rearrangement in `startSpanGeneric` (we
were setting the spanID too late, which led to tags being dropped).

Release note: None
tbg added a commit to tbg/cockroach that referenced this pull request Oct 27, 2020
We were previously shoehorning our tracing subsystem into the
opentracing framework. This resulted in lots of bending over
backwards to no real gain.

Move off the interfaces so that we can more easily refactor
the code for always-on tracing as well as make it more digestible.

This commit is mostly mechanical. A bunch of code around the
RPC interceptors was cribbed from the `otgrpc` package.

Cleanups are delegated to additional commits.

TestFollowerReadsWithStaleDescriptor, skipped temporarily in cockroachdb#55937,
passes again due to the rearrangement in `startSpanGeneric` (we
were setting the spanID too late, which led to tags being dropped).

Release note: None
craig bot pushed a commit that referenced this pull request Oct 28, 2020
56012: tracing: move off opentracing interfaces r=knz,irfansharif a=tbg

We were previously shoehorning our tracing subsystem into the
opentracing framework. This resulted in lots of bending over
backwards to no real gain.

Move off the interfaces so that we can more easily refactor
the code for always-on tracing as well as make it more digestible.

This commit is mostly mechanical. A bunch of code around the
RPC interceptors was cribbed from the `otgrpc` package.

Cleanups are delegated to additional commits.

TestFollowerReadsWithStaleDescriptor, skipped temporarily in #55937,
passes again due to the rearrangement in `startSpanGeneric` (we
were setting the spanID too late, which led to tags being dropped).

Release note: None


Co-authored-by: Tobias Grieger <tobias.b.grieger@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment