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

Serf.SetTags can race with itself #621

Open
dnephin opened this issue Dec 22, 2020 · 0 comments
Open

Serf.SetTags can race with itself #621

dnephin opened this issue Dec 22, 2020 · 0 comments

Comments

@dnephin
Copy link
Contributor

dnephin commented Dec 22, 2020

The godoc for the Serf struct says "All functions on the Serf structure are safe to call concurrently", but hashicorp/consul#9457 shows this is not true of SetTags. It updates a map without acquiring a lock.

Should there be a lock for accessing Serf.config ? Or should the godoc be updated to say that the caller is responsible for locking? Since the caller will need to synchronize the calls to get tags and set tags, it may be appropriate to leave the locking to the caller.

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

No branches or pull requests

1 participant