Revert "Avoid taking lock for empty bucket in ConcurrentDictionary.TryRemove …"#107653
Merged
stephentoub merged 1 commit intomainfrom Sep 11, 2024
Merged
Revert "Avoid taking lock for empty bucket in ConcurrentDictionary.TryRemove …"#107653stephentoub merged 1 commit intomainfrom
stephentoub merged 1 commit intomainfrom
Conversation
…yRemove …" This reverts commit 252018c.
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-collections |
Member
Author
|
/backport to release/9.0 |
Contributor
|
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10800991677 |
Member
Author
|
/backport to release/8.0-staging |
Contributor
|
Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/10801011682 |
eiriktsarpalis
approved these changes
Sep 11, 2024
jtschuster
pushed a commit
to jtschuster/runtime
that referenced
this pull request
Sep 17, 2024
…yRemove …" (dotnet#107653) This reverts commit 252018c.
sirntar
pushed a commit
to sirntar/runtime
that referenced
this pull request
Sep 30, 2024
…yRemove …" (dotnet#107653) This reverts commit 252018c.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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