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

refactor(accesscontrol): control concurrent access to AccessStore cache #290

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

aruiz14
Copy link
Contributor

@aruiz14 aruiz14 commented Oct 3, 2024

Issue: rancher/rancher#47318

Depends/stacked on #286

Uses singleflight to aggregate every concurrent calls to AccessFor for the same user. Unlike a regular mutex, this sync mechanism allows to control by key and ensures concurrent calls with the same key will all wait for the first one to complete, returning the same value for all of them.

@aruiz14 aruiz14 force-pushed the concurrent-AccessFor-fix branch from 938078a to 31cbd3f Compare October 8, 2024 15:41
@aruiz14 aruiz14 marked this pull request as ready for review October 8, 2024 15:41
@aruiz14 aruiz14 requested a review from a team as a code owner October 8, 2024 15:41
@aruiz14 aruiz14 requested review from moio and tomleb October 8, 2024 15:41
Copy link
Contributor

@tomleb tomleb left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ericpromislow ericpromislow left a comment

Choose a reason for hiding this comment

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

LGTM

@aruiz14
Copy link
Contributor Author

aruiz14 commented Oct 9, 2024

Thanks for the prompt review @tomleb @ericpromislow!
Could you please merge it for me? It seems I'm not authorized.

@moio moio merged commit 484ce1c into rancher:main Oct 9, 2024
1 check passed
@aruiz14 aruiz14 deleted the concurrent-AccessFor-fix branch October 9, 2024 08:48
@aruiz14 aruiz14 changed the title refactor(accesscontrol): use interface for AccessStore cache refactor(accesscontrol): control concurrent access to AccessStore cache Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants