Skip to content

fix context data structure to support multiple attributes#330

Merged
reyang merged 4 commits into
open-telemetry:masterfrom
lalitb:fix-context
Sep 17, 2020
Merged

fix context data structure to support multiple attributes#330
reyang merged 4 commits into
open-telemetry:masterfrom
lalitb:fix-context

Conversation

@lalitb
Copy link
Copy Markdown
Member

@lalitb lalitb commented Sep 17, 2020

A tiny(est) of fixes to prevent crash while creating new context from existing context properties. The reference variable was used to store list head and later to iterate over the context list (at line 46), which eventually crashes. Changed it to non-reference variable, and added test case to validate the scenario.

@lalitb lalitb requested a review from a team September 17, 2020 18:19
@lalitb lalitb changed the title Fix context fix context data structure to support multiple attributes Sep 17, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 17, 2020

Codecov Report

Merging #330 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #330      +/-   ##
==========================================
+ Coverage   94.60%   94.62%   +0.01%     
==========================================
  Files         148      148              
  Lines        6651     6655       +4     
==========================================
+ Hits         6292     6297       +5     
+ Misses        359      358       -1     
Impacted Files Coverage Δ
api/include/opentelemetry/context/context.h 100.00% <100.00%> (+1.81%) ⬆️
api/test/context/context_test.cc 100.00% <100.00%> (ø)

Copy link
Copy Markdown
Contributor

@pyohannes pyohannes left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this.

@reyang reyang merged commit 5d1898c into open-telemetry:master Sep 17, 2020
GerHobbelt pushed a commit to GerHobbelt/opentelemetry-cpp that referenced this pull request Jun 17, 2025
[SDK] Use shared_ptr internally for AttributesProcessor to prevent us…
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