Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Sep 2011 at 12:04 UTC
Updated:
11 Jul 2025 at 16:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
c960657 commentedThis adds lock_force_release($name).
I thought of adding lock_force_release_all(), but I think it is dangerous, because e.g. in the event of a server crash it will also remove any locks acquired after the server came back up. If we are to provide something along those lines, I suggest adding a function that returns a list of all locks currently held (so that the admin can inspect them and choose which to force-release using lock_force_release($name)). As an extra bonus this function could also return various information about each lock (e.g. when the lock was acquired, the process id of the request in which the lock was acquired, the server IP address (in a cluster), etc.) so that the admin would have a better way of deciding which locks can safely be force-released. But I guess this discussion belongs in a separate issue.
Comment #2
c960657 commentedComment #3
pounardI'm not sure this is a good idea, the right thing to do is probably to let really small lifetime on most lock we use in core. For all non system essential use, we probably should write a more complete application-level locking API.
Comment #4
c960657 commentedIf the lifetime is too short, you risk that the semaphores expire before the are released. This may cause some serious concurrency issues – issues that semaphores were meant to prevent. Also note, that “really small but not too small” is very dependent on the specific site and its current load.
I'd rather improve the existing API than having to maintain two locking APIs. I think core could also benefit from an improved API.
Here is a reroll of the old patch.
Comment #20
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #21
smustgrave commentedSince there's been no follow up in 3+ months going to close out. If still a desired feature please re-open updating any missing information
Thanks!