Skip to content

Commit

Permalink
Update x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/…
Browse files Browse the repository at this point in the history
…security/support/CacheIteratorHelper.java

Co-authored-by: Tim Vernum <[email protected]>
  • Loading branch information
ywangd and tvernum authored Sep 8, 2023
1 parent c087be2 commit 5b08511
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public CacheIteratorHelper(Cache<K, V> cache) {
// the lock is used in an odd manner; when iterating over the cache we cannot have modifiers other than deletes using the
// iterator but when not iterating we can modify the cache without external locking. When making normal modifications to the cache
// the read lock can be obtained so that we can allow concurrent modifications; however when we need to iterate over the keys or
// values
// of the cache the write lock must be obtained to prevent any modifications.
// values of the cache the write lock must be obtained to prevent any modifications.
// Note - the write lock is needed for concurrent modifications across Cache#put and Cache#invalidateAll
// see https://github.com/elastic/elasticsearch/issues/99326 for additional information
updateLock = new ReleasableLock(lock.readLock());
Expand Down

0 comments on commit 5b08511

Please sign in to comment.