Skip to content
New issue

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? Sign in to your account

[8.10] Fix deadlock between Cache.put and invalidateAll (#99480) #99579

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

thecoop
Copy link
Member

@thecoop thecoop commented Sep 14, 2023

Backports the following commits to 8.10:

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.
@thecoop thecoop added :Core/Infra/Core Core issues without another label >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Core/Infra Meta label for core/infra team labels Sep 14, 2023
@elasticsearchmachine elasticsearchmachine merged commit a94744f into elastic:8.10 Sep 14, 2023
@thecoop thecoop deleted the backport/8.10/pr-99480 branch September 14, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team v8.10.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants