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

HDDS-9237. Enable lock order fairness for striped locks. #5256

Merged
merged 3 commits into from
Sep 12, 2023

Conversation

duongkame
Copy link
Contributor

@duongkame duongkame commented Sep 7, 2023

What changes were proposed in this pull request?

HDDS-8765 uses Guava's Striped to implement striped locks in OM. For now, Striped doesn't allow creating striped locks with a custom fairness order. Details are in #4885.

There's a open issue and a PR in Guava to address that, but looks like they're not reviewed by Guava devs for a long time.

This PR implements a factory of com.google.common.util.concurrent.Striped which uses reflection to create Striped locks with fair order policy.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9237

How was this patch tested?

Unit-tested.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @duongkame for the patch. LGTM, but test should be renamed to get executed.

@duongkame
Copy link
Contributor Author

Thanks @duongkame for the patch. LGTM, but test should be renamed to get executed.

Thanks @adoroszlai. Test is fixed now.

@kerneltime kerneltime merged commit af72296 into apache:master Sep 12, 2023
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants