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

Protect entityMetadataMap from concurrent access #197

Closed
Sriep opened this issue Apr 20, 2021 · 0 comments · Fixed by #214
Closed

Protect entityMetadataMap from concurrent access #197

Sriep opened this issue Apr 20, 2021 · 0 comments · Fixed by #214
Assignees
Labels

Comments

@Sriep
Copy link
Contributor

Sriep commented Apr 20, 2021

entityMetadataMap is a global map accessed from numerous files across the project. It should be protected from concurrent access.

Adding a RWMutex to RegisterEntityMetadata and GetEntityMetadata should be sufficient.

This causes a race issue when running go test -race on the /0chain/code/go/0chain.net/sharder/blockstore/ directory.

@Sriep Sriep changed the title Protect entityMetadataMap from concurrent access. Protect entityMetadataMap from concurrent access Apr 20, 2021
@Sriep Sriep added the bug label Apr 20, 2021
@Sriep Sriep removed their assignment Apr 27, 2021
platsko added a commit that referenced this issue Apr 29, 2021
@platsko platsko self-assigned this Apr 30, 2021
platsko added a commit that referenced this issue May 2, 2021
@Sriep Sriep closed this as completed in #214 May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants