Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apm: fix data race accessing Tracer.active #406

Merged
merged 2 commits into from
Jan 4, 2019

Conversation

axw
Copy link
Member

@axw axw commented Jan 4, 2019

When Tracer.loop exits, it sets Tracer.active
to false, which races with reads by the method
Tracer.Active. We fix this by changing the
Tracer.active field from a bool to int32, and
using atomic ops.

Fixes #404

When Tracer.loop exits, it sets Tracer.active
to false, which races with reads by the method
Tracer.Active. We fix this by changing the
Tracer.active field from a bool to int32, and
using atomic ops.
@codecov-io
Copy link

codecov-io commented Jan 4, 2019

Codecov Report

Merging #406 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #406      +/-   ##
==========================================
+ Coverage   83.96%   83.98%   +0.01%     
==========================================
  Files         102      102              
  Lines        6136     6137       +1     
==========================================
+ Hits         5152     5154       +2     
  Misses        913      913              
+ Partials       71       70       -1
Impacted Files Coverage Δ
tracer.go 88.6% <100%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d26c08b...d407caf. Read the comment docs.

@axw axw merged commit 9f89e36 into elastic:master Jan 4, 2019
@axw axw deleted the tracer-active-race branch January 4, 2019 03:47
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.

Race condition between Tracer.Active and Tracer.loop
2 participants