https://github.com/elastic/elasticsearch
Revision a94744f97522b2b7ee8b5dc13be7ee11082b8d6b authored by Simon Cooper on 14 September 2023, 15:25:26 UTC, committed by GitHub on 14 September 2023, 15:25:26 UTC
The invalidateAll method is taking out the lru lock and segment locks in a different order to the put method, when the put is replacing an existing value. This results in a deadlock between the two methods as they try to swap locks. This fixes it by making sure invalidateAll takes out locks in the same order as put.

This is difficult to test because the put needs to be replacing an existing value, and invalidateAll clears the cache, resulting in subsequent puts not hitting the deadlock condition. A test that overrides some internal implementations to expose this particular deadlock will be coming later.
1 parent 5196f81
History
Tip revision: a94744f97522b2b7ee8b5dc13be7ee11082b8d6b authored by Simon Cooper on 14 September 2023, 15:25:26 UTC
Fix deadlock between Cache.put and invalidateAll (#99480) (#99579)
Tip revision: a94744f
File Mode Size
.buildkite
.ci
.github
.idea
benchmarks
build-conventions
build-tools
build-tools-internal
client
dev-tools
distribution
docs
gradle
libs
licenses
modules
plugins
qa
rest-api-spec
server
test
x-pack
.backportrc.json -rw-r--r-- 333 bytes
.dir-locals.el -rw-r--r-- 3.3 KB
.editorconfig -rw-r--r-- 9.0 KB
.git-blame-ignore-revs -rw-r--r-- 795 bytes
.gitattributes -rw-r--r-- 221 bytes
.gitignore -rw-r--r-- 1.2 KB
BUILDING.md -rw-r--r-- 13.0 KB
CHANGELOG.md -rw-r--r-- 170 bytes
CONTRIBUTING.md -rw-r--r-- 48.9 KB
LICENSE.txt -rw-r--r-- 546 bytes
NOTICE.txt -rw-r--r-- 150 bytes
README.asciidoc -rw-r--r-- 8.0 KB
REST_API_COMPATIBILITY.md -rw-r--r-- 17.4 KB
TESTING.asciidoc -rw-r--r-- 37.7 KB
TRACING.md -rw-r--r-- 7.6 KB
Vagrantfile -rw-r--r-- 14.9 KB
build.gradle -rw-r--r-- 15.5 KB
catalog-info.yaml -rw-r--r-- 9.2 KB
gradle.properties -rw-r--r-- 1.2 KB
gradlew -rwxr-xr-x 8.3 KB
gradlew.bat -rw-r--r-- 2.8 KB
settings.gradle -rw-r--r-- 5.5 KB

README.asciidoc

back to top