Skip to content

Keep track of pending Redis get calls in client side caching to avoid race with invalidations. #3481#3497

Open
IvarHenckel wants to merge 1 commit intoredis:mainfrom
IvarHenckel:client-side-caching-fix-invalidation-race-bug-3481
Open

Keep track of pending Redis get calls in client side caching to avoid race with invalidations. #3481#3497
IvarHenckel wants to merge 1 commit intoredis:mainfrom
IvarHenckel:client-side-caching-fix-invalidation-race-bug-3481

Conversation

@IvarHenckel
Copy link

@IvarHenckel IvarHenckel commented Nov 2, 2025

Closes #3481

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

@jit-ci
Copy link

jit-ci bot commented Nov 2, 2025

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@IvarHenckel
Copy link
Author

So far didn't add any tests. I felt I was only changing internal parts and there is already tests against the end behavior. Testing the race itself, i.e. somehow mocking the order of threads, is tricky. But let me know if you prefer more tests.

@IvarHenckel
Copy link
Author

FYI I have been applying the same fix in my production code, it has been running there for weeks successfully. Would be nice to clean up the code by getting this fix into lettuce (currently have the implementation of CacheAccessor in our code base). And of course, to fix the issue for others.

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.

Invalidation race causing stale cache for io.lettuce.core.support.caching.ClientSideCaching

1 participant