Open dgunay opened 10 months ago
For anyone reading this, if you do not want to fork then you can work around the issue by essentially wrapping the library yourself in a RWMutex
.
Maybe fixed by #48 ? I haven't read the PR yet but presumably using sync.Map
would fix this.
Hi @dgunay
The v1 was not 100% thread-safe. We are working on the matter for v2 (WIP).
When a service is not found in
Invoke/MustInvoke/InvokeNamed
,serviceNotFound
is calledwhich calls
keys(i.services)
.keys
performs a read oni.services
butserviceNotFound
hasn't acquired the mutex for reading. This trips the race detector in some of my tests.Solution is probably to just acquire the mutex for reading at the beginning of either
serviceNotFound
orInvokeNamed
.data race: