watermill
watermill copied to clipboard
Data race on Publish for Google pubsub
Running code with -race that publishes from multiple goroutines at the same time:
WARNING: DATA RACE
Write at 0x00c002c291d8 by goroutine 1498:
github.com/ThreeDotsLabs/watermill-googlecloud/pkg/googlecloud.(*Publisher).Publish()
github.com/ThreeDotsLabs/[email protected]/pkg/googlecloud/publisher.go:149 +0xe4
[...]
Previous write at 0x00c002c291d8 by goroutine 1439:
github.com/ThreeDotsLabs/watermill-googlecloud/pkg/googlecloud.(*Publisher).Publish()
github.com/ThreeDotsLabs/[email protected]/pkg/googlecloud/publisher.go:149 +0xe4
[...]
Line 149 is:
t.EnableMessageOrdering = p.config.EnableMessageOrdering
which is a write to a shared Topic without synchronization.