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?
to your account
Todd Lindner opened SPR-13492 and commented
AbstractCacheManager.getCache(String name) creates caches lazily on access. If the same cache is requested in two different threads it is possible for getMissingCache(name) to be invoked twice.
Suggestion is to add a double-lock mechanism when lookupCache(name) returns null.
Referenced from: commits 75ea6f5
The text was updated successfully, but these errors were encountered:
Juergen Hoeller commented
Indeed, under this race condition, application code may potentially be using two different Cache references for the same cache, depending on when the getCache calls happened.
I've revised AbstractCacheManager overall for consistent locking when caches get added, in particular also managing the cacheNames Set more defensively in such a scenario.
Sorry, something went wrong.
Todd Lindner commented
Note that due to the potential implications of the additional locking here, I'm leaving this as a 4.2.2 only change, not backporting it to 4.1.8.
No branches or pull requests