Skip to content

[RateLimiting] Update TranslateKey to allow disposal of wrapped limiter #73160

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

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

BrennanConroy
Copy link
Member

Fixes #72551

@ghost
Copy link

ghost commented Aug 1, 2022

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned BrennanConroy Aug 1, 2022
@ghost
Copy link

ghost commented Aug 1, 2022

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #72551

Author: BrennanConroy
Assignees: -
Labels:

area-System.Threading

Milestone: 7.0.0

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

What is the CompareExchange trying to protect against? Concurrent calls to Dispose/DisposeAsync? Seems like overkill.

Also, Translate_DisposeDoesDisposeInnerLimiter and Translate_DisposeDoesNotDisposeInnerLimiter sounds like contradictory tests lol. No need to make it method name wordier. I just thought it was sorta funny.

@BrennanConroy
Copy link
Member Author

What is the CompareExchange trying to protect against? Concurrent calls to Dispose/DisposeAsync? Seems like overkill.

Yes. Thought it was better than allocating a lock object and using that.

@BrennanConroy BrennanConroy force-pushed the brecon/translatedispose branch from d49b486 to 0dcdba3 Compare August 12, 2022 01:12
@BrennanConroy BrennanConroy merged commit 4fac43b into dotnet:main Aug 12, 2022
@BrennanConroy BrennanConroy deleted the brecon/translatedispose branch August 12, 2022 15:28
@ghost ghost locked as resolved and limited conversation to collaborators Sep 11, 2022
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.

[API Proposal]: Add leaveOpen concept to PartitionedRateLimiter.TranslateKey
2 participants