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

Fix a panic due to unsafe concurrent map access #5995

Merged
merged 7 commits into from
Dec 22, 2020

Conversation

lblackstone
Copy link
Member

State tracking for goals was implemented using a raw map,
but this was not safe for concurrent read/write access from
multiple goroutines. Switched to using a sync.Map, which
is threadsafe.

Fix #5993

State tracking for goals was implemented using a raw map,
but this was not safe for concurrent read/write access from
multiple goroutines. Switched to using a sync.Map, which
is threadsafe.
Copy link
Member

@lukehoban lukehoban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good. Would be great to have test coverage on this - as it feels like a subtle enough issue that we might re-introduce later. Maybe even add -race to test suite as in #1605?

@lblackstone
Copy link
Member Author

Would be great to have test coverage on this - as it feels like a subtle enough issue that we might re-introduce later.

Agreed, although I think we should go ahead and release this fix if it passes CI testing, and then expand the test coverage separately.

Copy link
Member

@pgavlin pgavlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto re: tests. Fix LGTM.

@lblackstone lblackstone merged commit 795a11c into master Dec 22, 2020
@pulumi-bot pulumi-bot deleted the lblackstone/fix-map-panic branch December 22, 2020 19:04
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 this pull request may close these issues.

fatal error: concurrent map read and map write
3 participants