Skip to content

Synchronize get value loaders taking cache key into account #2083

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

Conversation

miensol
Copy link
Contributor

@miensol miensol commented Jun 11, 2021

The previous version synchronize all calls to get(key, valueLoader). After this PR, the calls to value loader will only be synchronized if we do not have a value for the given key.

This is an extension of #2082.

This version synchronizes loaders taking key into account.

Fixes #2079

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

The previous version synchronize all calls to `get(key, valueLoader)`. After this PR the calls to value loader will only be synchronised if we do not have value for the given key.

Fixes spring-projects#2079
@miensol miensol changed the title Synchronize get with value loader only if value is absent for given key Synchronize get value loaders taking cache key into account Jun 11, 2021
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 11, 2021
@christophstrobl
Copy link
Member

I share the concerns, about keeping a mutex within RedisCache, @mp911de outlined in #2079, .
At this point this is something that we don’t want to add.
Thanks for the time invested, both, on discussing the issue, as well as creating this PR.

@christophstrobl christophstrobl added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RedisCache synchronises all get(key, valueLoader) calls
3 participants