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

Fixes deadlock between barrier write and leader notify channel read .… #3231

Merged
merged 2 commits into from
Jul 6, 2017

Conversation

preetapan
Copy link
Contributor

Fixes #3230

@preetapan preetapan requested a review from slackpad July 5, 2017 22:13
Copy link
Contributor

@slackpad slackpad left a comment

Choose a reason for hiding this comment

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

Two tiny nits, otherwise LGTM.

leaderCh := make(chan bool, 1)
s.config.RaftConfig.NotifyCh = leaderCh
s.leaderCh = leaderCh
raftReconcileChannel := make(chan bool, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

The name "reconcile" has a special meaning where we sync the leader's Serf members with the catalog, so I'd avoid that and change raftReconcileCh to raftNotifyCh for the local variable here, or you could do:

s.raftNotifyCh = make(chan bool, 1)
s.config.RaftConfig.NotifyCh = s.raftNotifyCh

@@ -35,13 +36,13 @@ func (s *Server) monitorLeadership() {
// leaderCh, which is only notified best-effort. Doing this ensures
// that we get all notifications in order, which is required for
// cleanup and to ensure we never run multiple leader loops.
leaderCh := s.leaderCh
raftNotifyCh := s.raftNotifyChanel
Copy link
Contributor

Choose a reason for hiding this comment

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

sp. "Chanel"

@preetapan preetapan merged commit 4abbbc9 into master Jul 6, 2017
@slackpad slackpad deleted the issue_3230 branch August 8, 2017 18:36
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.

2 participants