Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Use pointer type for right use of mutex #212

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

morikuni
Copy link
Contributor

Hi, I found a bug in a default SourceCodeLoader.

fsLoader uses sync.Mutex, but its receiver type of Load is a value.
So mu.Lock and mu.Unlock does not affects shared state.
It causes race condition when writing fsLoader.cache from multiple goroutines.

@mattrobenolt mattrobenolt merged commit adb5dff into getsentry:master Oct 23, 2018
@mattrobenolt
Copy link
Contributor

Thanks for the fix! 🍕

@morikuni morikuni deleted the use-pointer branch October 24, 2018 02:11
@pierrre
Copy link

pierrre commented Oct 31, 2018

Thank you ! 👍
I just had a panic/crash in production today concurrent map writes.
I think it will fix it.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants