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

Conversation

@rleungx
Copy link
Member

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 Oct 16, 2018

@rleungx rleungx force-pushed the rleungx:fix-wg-data-race branch from edcf7fa to a1e75fb Oct 16, 2018

@nolouch
Copy link
Member

left a comment

LGTM

@nolouch nolouch merged commit 9b3ebe1 into pingcap:master Oct 17, 2018

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-pd/build Jenkins job succeeded.
Details
jenkins-ci-pd/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
rleungx added a commit to rleungx/pd that referenced this pull request Oct 23, 2018
disksing added 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
Projects
None yet
3 participants
You can’t perform that action at this time.