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

[exporter/datadog] Avoid logging in chain provider goroutines to avoid data race #24899

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Aug 4, 2023

Description:

Fixes data race on TestChain that was caused by logging after the test was ended (see uber-go/zap#687 (comment) for details).
To do this, we move the logging outside of the goroutines in the Chain provider.
Goroutines can still be running after the function has returned (this is intentional, their return value will just be ignored), but they will no longer log anything.

I also made the Source method honor cancellation of the context when waiting on providers.

Link to tracking Issue: Reported on Slack, see https://cloud-native.slack.com/archives/C01N6P7KR6W/p1691074033049049?thread_ts=1690992010.123699&cid=C01N6P7KR6W

@mx-psi mx-psi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Aug 4, 2023
@github-actions github-actions bot added the exporter/datadog Datadog components label Aug 4, 2023
@mx-psi mx-psi marked this pull request as ready for review August 4, 2023 12:35
@mx-psi mx-psi requested a review from a team as a code owner August 4, 2023 12:35
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

LGTM

@mx-psi mx-psi merged commit cfb8f20 into open-telemetry:main Aug 4, 2023
89 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/datadog Datadog components Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants