data race in lib/serf.UpdateTag #9457
Labels
theme/internals
Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics
type/bug
Feature does not function as expected
There are actually 2 races here.
Serf.SetTags
can race with itself. The godoc for theSerf
struct claims that all methods should be safe for concurrent use, but there is no lock aroundSetTags
, so this is not the case. I'm not sure if it should be the responsibility of serf or the caller to handle that locking. (Serf.SetTags can race with itself serf#621)lib/serf.UpdateTag
is to first get the tags fromSerf.GetTags
, mutate the map, then set the tags. But there is no lock! So if two goroutines attempt to update the tags at the same time, the secondSetTags
may not include all the tags from the first, and some tags would have effectively been removed.The text was updated successfully, but these errors were encountered: