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

fix(bolt): prevent concurrent access to telegraf plugin metrics cache #21042

Merged
merged 6 commits into from
Mar 23, 2021

Conversation

danxmoran
Copy link
Contributor

Closes #20999

I'm not happy with the timing-based pieces of the test I added, but it's probably better than nothing?

bolt/metrics.go Outdated Show resolved Hide resolved
bolt/metrics.go Show resolved Hide resolved
require.NoError(t, tsvc.CreateTelegrafConfig(ctx, &tconf, 2))

// Let a few more background gathers run.
time.Sleep(250 * time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

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

These sleeps seem fine, we want to flush out race conditions.

@danxmoran danxmoran requested a review from lesam March 23, 2021 15:12
bolt/metrics.go Show resolved Hide resolved
@danxmoran danxmoran merged commit 4c59a34 into master Mar 23, 2021
@danxmoran danxmoran deleted the dm-bolt-metrics-panic-20999 branch March 23, 2021 18:16
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.

panic in bolt/metrics.go due to concurrent map iteration and map write
2 participants