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 race condition in NumNodes for TransmitLimitedQueue #452

Merged
merged 1 commit into from
Feb 9, 2017

Conversation

tyler
Copy link
Contributor

@tyler tyler commented Feb 9, 2017

Fixes #426 by using serf.NumNodes in place of the len(serf.members) calls in the instantiation of TransmitLimitedQueue.

serf/serf.go Outdated
@@ -751,6 +745,13 @@ func (s *Serf) Members() []Member {
return members
}

func (s *Serf) membersLength() int {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @tyler I knew this seemed familiar :-) There's an existing NumNodes() method on the Serf you can call that does this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh jeez, how did I miss that... fix incoming.

@slackpad slackpad merged commit cb45b41 into hashicorp:master Feb 9, 2017
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