Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Because the lock is now injected into some services and we add the cleanup as a shutdown function in __construct(), that means we execute DELETE FROM semaphore WHERE (value = :db_condition_placeholder_0) on every request.
We need to move this so that it's only added when we actually request a lock.
Comment | File | Size | Author |
---|---|---|---|
#1 | improve-lock-release-all-1966614-1.patch | 928 bytes | Berdir |
Comments
Comment #1
BerdirThis is one way to solve it. Only execute the query if any locks were acquired.
The alternative would be to conditionally register the shutdown function.
Comment #2
dawehnerIs there an issue which injects the db connection into the lock object? If we do that, it would be certainly better to test.
Comment #3
BerdirI don't think that there's such an issue, should be easy in this case as we directly register the implementation as a service and don't have any managers/factories that make things complicated :)
Comment #4
catchThat's full of nasty, but the fix looks fine to me. Committed/pushed to 8.x.