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

server: fix WaitGroup data race #1273

Merged
merged 2 commits into from
Oct 17, 2018
Merged

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Oct 16, 2018

What problem does this PR solve?

At present, coordinator uses WaitGroup to synchronize. We call Add() in (c *coordinator) run() and Wait() in (c *coordinator) stop() which are in different goroutines. So the data race could happen when the leader drops. This PRs closes #1268.

What is changed and how it works?

Check List

Tests

  • Manual test (make test)

Related changes

  • Need to be included in the release notes

@rleungx rleungx requested review from nolouch and disksing October 16, 2018 02:45
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

LGTM

@nolouch nolouch merged commit 9b3ebe1 into tikv:master Oct 17, 2018
@disksing disksing added the needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch. label Oct 23, 2018
rleungx added a commit to rleungx/pd that referenced this pull request Oct 23, 2018
disksing pushed a commit that referenced this pull request Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-2.1 The PR needs to cherry pick to release-2.1 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data race occurs when running tests
3 participants