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
sync: Map.Store() crash with fatal error: sync: unlock of unlocked mutex #26480
Comments
I can't see how that line could be unlocking an unlocked map. It is dominated by the lock call. Any chance you're copying the
Is there any way you can share the code so we can reproduce this crash? |
Hi, @randall77 i am aware of the copying map issue, and i confirm we are not copying the map. i will provide a mock code
what we do is during start up, we create an instance and make it available globally
and we have a ticker that is called every 10minutes (we collect data and adapat/store in elasticSearch) we do not copy the instance, |
Unless the Flush() method is the issue ? what are doing is trying to restart over once data is on elastic search, |
Yes, I think |
Speaking of which, the race detector should have caught this bug. Have you tried running with the race detector on? |
We have a test that go/src/cmd/vet/testdata/copylock_func.go Line 14 in 9092511
|
When i run a go vet nothing is reported, And this is very random, and very hard to reproduce, but in production it happens many times a day. i will try to improve the Flush() method and see how this can help. |
@bcmills I think the vet copylock check isn't triggered when the RHS is a composite literal. Presumably because copying a zero lock is allowed. |
@amezghal - Do you get any errors under the race detector ? |
Once i have updated the Refresh method i no longer get this error, |
Ok, I'll close this issue then. |
Yes |
Hello,
Did the race detector spot this problem?
Thanks
…On 26 July 2018 at 19:57, amezghal abdelilah ***@***.***> wrote:
Yes Refresh
re init the sync.Map while it was being excessively updated without
synchronisation from other go-routines was the issue.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26480 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA4-bNJ8Trus-9k9F3egf_beQ7RmAks5uKZKGgaJpZM4VWu-w>
.
|
@davecheney yes the racedetector is reporting the data race, thks |
Thanks for confirming.
…On 26 July 2018 at 21:01, amezghal abdelilah ***@***.***> wrote:
@davecheney <https://github.com/davecheney>
I restored the old code and run it with the -race,
yes the racedetector is reporting the data race,
thks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26480 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA2fiPDxNcFlJZSulZj3t8TwFD8LJks5uKaF4gaJpZM4VWu-w>
.
|
Hi,
For some reason our service crashes with this unrecoverable error:
we are using sync.Map as intended (filling the map from multiple go routines).
it's very random, and i can't force the crash, but it happens many times per day.
Thanks
The text was updated successfully, but these errors were encountered: