[12.x] CacheSchedulingMutex should use lock connection #56472
Merged
+70
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #55610 by updating
CacheSchedulingMutex
to use the lock connection instead of the default cache connection when acquiring a mutex. This mirrors the existing behavior ofCacheEventMutex
and ensures consistency.To maintain API compatibility, I replicated the locking logic used in
CacheEventMutex
.In our production environment, the default cache connection is not using the same instance for all servers, while the lock connection is. As described in the referenced issue, this leads to race conditions unless a workaround (defining a separate store) is implemented. The current behavior is unintuitive and, in my view, should be corrected even though a workaround exists.
Considerations