Skip to content
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

Fatal error on GetFeatureFlag: concurrent map writes #80

Open
albertteoh opened this issue Dec 16, 2024 · 0 comments · May be fixed by #81
Open

Fatal error on GetFeatureFlag: concurrent map writes #80

albertteoh opened this issue Dec 16, 2024 · 0 comments · May be fixed by #81

Comments

@albertteoh
Copy link

Our application crashed with the following error:

fatal error: concurrent map writes

goroutine 7975 [running]:
github.com/posthog/posthog-go.(*SizeLimitedMap).add(...)
	/src/vendor/github.com/posthog/posthog-go/util.go:26
github.com/posthog/posthog-go.(*client).GetFeatureFlag(0xc000b7a100, {{0x1e0b64c, 0x2d}, {0x1dbe3a5, 0xc}, 0xc0017f8780, 0xc0017f87b0, 0xc0017f87e0, 0x0, 0xc0005abfb0})

It appears there was a concurrent write on the sizeLimitedMap.ids map.

Go's maps do not support safe concurrent writes.

@albertteoh albertteoh linked a pull request Dec 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant