Skip to content

util/tracing: re-key activeSpans map on span ID#60666

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
angelapwen:rekey-activeSpans-map
Feb 17, 2021
Merged

util/tracing: re-key activeSpans map on span ID#60666
craig[bot] merged 1 commit intocockroachdb:masterfrom
angelapwen:rekey-activeSpans-map

Conversation

@angelapwen
Copy link
Copy Markdown

Note that the changes in this PR should be used in #60616 to more easily retrieve a span given its span ID, without having to visit all spans and check for a match on span ID. Whichever PR lands later should update the sections of code marked as #TODOs in #60616.

Previously, a tracer's activeSpans map was keyed on the memory
address of the span itself. This commit keys the map on the span ID
(which is deterministically unique) and sets the corresponding
value in the map to be the memory address of the span itself. This
allows us to continue to visit all active spans via the map, but
also easily retrieve a span from its ID using the map.

Release note: None

@angelapwen angelapwen self-assigned this Feb 17, 2021
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Previously, a Tracer's `activeSpans` map was keyed on the memory
address of the span itself. This commit keys the map on the span ID
(which is deterministically unique) and sets the corresponding
value in the map to be the memory address of the span itself. This
allows us to continue to visit all active spans via the map, but
also easily retrieve a span from its ID using the map.

Release note: None
@angelapwen angelapwen force-pushed the rekey-activeSpans-map branch from df67f3a to 85becc0 Compare February 17, 2021 10:19
@angelapwen
Copy link
Copy Markdown
Author

bors r=irfansharif

Thanks for the review 🙏

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 17, 2021

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 17, 2021

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants