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

OrderedMap.ForEach is not "really" thread safe #2615

Open
hmoog opened this issue Mar 17, 2023 · 0 comments
Open

OrderedMap.ForEach is not "really" thread safe #2615

hmoog opened this issue Mar 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hmoog
Copy link
Contributor

hmoog commented Mar 17, 2023

Bug description

OrderedMap.ForEach can result in a situation, where the iteration order is somewhat undefined while we are iterating if the elements get mutated during the iteration

Expected behaviour

Calling ForEach should give us the elements that are in the map by the time ForEach is called (make a copy).

Actual behaviour

Calling ForEach locks only each iterated entry, which means that if the order changes in between, we might miss or skip some entries.

@hmoog hmoog added the bug Something isn't working label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant