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 panic in tailer due to race condition between send() and close() #986

Merged

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented Sep 9, 2019

What this PR does / why we need it:

Fix a panic in the ingester tailer when send() and close() are executed at the same time.

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

Special notes for your reviewer:

  • Refactoring: renamed done into closeChan to make it more clear it's a channel used to signal the close()
  • Refactoring: changed closeMtx in closeOnce to make it more clear it's just used to run the close() once
  • The test fails with the previous logic

Checklist

  • Documentation added
  • 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

@cyriltovena cyriltovena merged commit 29f08cc into grafana:master Sep 9, 2019
@pracucci pracucci deleted the fix-tailer-close-race-condition-panic branch September 10, 2019 09:43
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.

ingester panic in tailing code
2 participants