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 a panic when trying to stop boltdb-shipper multiple times using sync.once #2613

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
When boltdb-shipper is used in multiple schema configs we share the same instance. When we stop the store service it tries to stop the same boltdb-shipper client multiple times causing it to panic on already closed channel.
This PR fixes the issue by using sync.Once.

Which issue(s) this PR fixes:
Fixes #2609

Checklist

  • Tests updated

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

Codecov Report

Merging #2613 into master will decrease coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2613      +/-   ##
==========================================
- Coverage   62.93%   62.87%   -0.06%     
==========================================
  Files         169      169              
  Lines       15023    15025       +2     
==========================================
- Hits         9454     9447       -7     
- Misses       4812     4821       +9     
  Partials      757      757              
Impacted Files Coverage Δ
pkg/storage/stores/shipper/shipper_index_client.go 0.00% <0.00%> (ø)
pkg/querier/queryrange/downstreamer.go 95.87% <0.00%> (-2.07%) ⬇️
pkg/promtail/targets/file/filetarget.go 65.14% <0.00%> (-1.72%) ⬇️
pkg/logql/evaluator.go 92.47% <0.00%> (-0.41%) ⬇️

@sandeepsukhani sandeepsukhani merged commit e53d203 into grafana:master Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ingester Panic on shutdown when using boltdb-shipper
3 participants