Browse Source
Prior to this commit, using a dynamic `CaffeineCacheManager` would rely on `ConcurrentHashMap#computeIfAbsent` for retrieving and creating cache instances as needed. It turns out that using this method concurrently can cause lock contention even when all known cache instances are instantiated. This commit avoids using this method if the cache instance already exists and avoid storing `null` entries in the map. This change reduces lock contention and the overall HashMap size in the non-dynamic case. Fixes gh-30066pull/30087/head
Brian Clozel
2 years ago
1 changed files with 9 additions and 3 deletions
Loading…
Reference in new issue