This module could implement a lock back-end.
As long as the APCu keys used for locks do not conflict with the APCu keys used for the cache, there should not be any issue with the module implementing two back-end types.

CommentFileSizeAuthor
#1 apc-lock-2332725-1.patch5.53 KBgielfeldt

Issue fork apc-2332725

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gielfeldt’s picture

StatusFileSize
new5.53 KB

Here's a patch.

mikeytown2’s picture

Status: Active » Needs review
avpaderno’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll

Prem Suthar made their first commit to this issue’s fork.

prem suthar’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thank you for creating a merge request!

This issue has been tagged with Needs reroll because the patch needed to be re-written to use functions exposed from the APCu extension, not from the APC extension, which is no longer developed nor supported.

There are also other changes that need to be done.
For example, there is probably no need to keep a list of locks as global variable, and there is probably no need to have a shutdown callback to remove all the locks that are still not expired. APCu associates a TTL to its values; after the TTL is passed, the value is automatically purged.

avpaderno’s picture

Status: Needs work » Needs review
avpaderno’s picture

Issue tags: -Needs tests

Actually, without editing the settings.php file, it is not possible to set a different lock back-end.
When tests are executed, Drupal core already loaded the includes/lock.inc file. Loading another file that defines the same functions contained in that file, as required to implement a lock back-end, causes errors like Cannot redeclare lock_initialize().

avpaderno’s picture

Title: Lock backend » Implement a lock backend
Category: Feature request » Task
Issue summary: View changes
avpaderno’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev

avpaderno changed the visibility of the branch 2332725-lock-backend-backport to hidden.

avpaderno’s picture

Status: Needs review » Fixed
Issue tags: -Needs reroll

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.