hashicorp/raft

Serf.SetTags can race with itself

dnephin opened this issue · 1 comments

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.

Oops, and I opened this on the wrong repo. Sorry for the noise.