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

Release lock when deleting cache key #23624

Merged
merged 1 commit into from
May 29, 2022
Merged

Conversation

mattwire
Copy link
Contributor

Overview

I'm seeing SqlGroup: Failed to acquire lock on cache key. intermittently on a number of sites. I'm not able to trace the reason because it might happen once a day or less and the cause of the error is always the previous request - ie. the current request cannot get a lock because the previous request didn't release it.

Before

if CRM_Utils_Cache_SqlGroup::set() called with ttl<=0 cache key is deleted but lock is never released.

After

if CRM_Utils_Cache_SqlGroup::set() called with ttl<=0 cache key is deleted and lock is released.

Technical Details

You can see by tracing the function delete() that it performs various actions before returning but does not release the lock. The lock is only released at the bottom of the set() function but the code returns immediately after the call to delete and never reaches the lock release code.

Comments

@civibot
Copy link

civibot bot commented May 29, 2022

(Standard links)

@civibot civibot bot added the master label May 29, 2022
@seamuslee001
Copy link
Contributor

This seems fine to me and tests have passed merging

@seamuslee001 seamuslee001 merged commit ee35b88 into civicrm:master May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants