Skip to content

Revert "Avoid taking lock for empty bucket in ConcurrentDictionary.TryRemove …"#107653

Merged
stephentoub merged 1 commit intomainfrom
revert-82004-cdtryremove
Sep 11, 2024
Merged

Revert "Avoid taking lock for empty bucket in ConcurrentDictionary.TryRemove …"#107653
stephentoub merged 1 commit intomainfrom
revert-82004-cdtryremove

Conversation

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Sep 10, 2024

This reverts commit 252018c. That change was considered safe within the context of TryRemove, in that it doesn't affect the behavior of TryRemove in isolation. But it's definitely confusing in conjunction with other APIs, where with no other concurrent removals, you could call ContainsKey, have it return true, and then have TryRemove return false.

#107525

We should backport this to at least release/9.0 if not also release/8.0.

Best reviewed without whitespace:
https://github.com/dotnet/runtime/pull/107653/files?w=1

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

@stephentoub
Copy link
Member Author

/backport to release/9.0

@github-actions
Copy link
Contributor

@dotnet dotnet deleted a comment from github-actions bot Sep 10, 2024
@stephentoub
Copy link
Member Author

/backport to release/8.0-staging

@github-actions
Copy link
Contributor

@stephentoub stephentoub merged commit 1231a9a into main Sep 11, 2024
@stephentoub stephentoub deleted the revert-82004-cdtryremove branch September 11, 2024 20:49
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 17, 2024
sirntar pushed a commit to sirntar/runtime that referenced this pull request Sep 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants