-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Data race: unsynchronized read of Injector.services
in serviceNotFound
#43
Comments
dgunay
changed the title
Data race on Injector.services in
Data race: unsynchronized read of Sep 15, 2023
serviceNotFound
Injector.services
in serviceNotFound
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 |
Maybe fixed by #48 ? I haven't read the PR yet but presumably using |
Hi @dgunay The v1 was not 100% thread-safe. We are working on the matter for v2 (WIP). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
The text was updated successfully, but these errors were encountered: