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

Remove unnecessary class-level synchronized in ManifestFiles #10544

Conversation

findepi
Copy link
Member

@findepi findepi commented Jun 20, 2024

It was guarding CONTENT_CACHES access, but this field is a concurrent data structure (Caffeine) and does not need external synchronization.

It was guarding `CONTENT_CACHES` access, but this field is a concurrent
data structure (`Caffeine`) and does not need external synchronization.
@github-actions github-actions bot added the core label Jun 20, 2024
@findepi
Copy link
Member Author

findepi commented Jun 20, 2024

@rizaon am i thinking about this right?

@findepi findepi requested review from Fokko and jackye1995 June 27, 2024 19:48
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

LGTM Thanks @findepi

@amogh-jahagirdar
Copy link
Contributor

amogh-jahagirdar commented Jul 19, 2024

Sorry for the late review on this @findepi , I was going through #10494 and trying to understand more about this path and saw this change as well. This particular change seems very safe to me since Caffeine already is threadsafe with respect to a given key. We don't a lock around manipulating the data structure, multiple threads can perform the dropCache and it'll be fine.

@amogh-jahagirdar amogh-jahagirdar merged commit cb6540c into apache:main Jul 19, 2024
45 checks passed
@findepi findepi deleted the findepi/remove-unnecessary-class-level-synchronized-in-manifestfiles-89cf7f branch July 19, 2024 09:02
@findepi
Copy link
Member Author

findepi commented Jul 19, 2024

good point, @amogh-jahagirdar
thank you @amogh-jahagirdar @Fokko for review and merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants