CacheCollector::normalizeLockName() is pointless

Created on 28 March 2024, over 1 year ago
Updated 12 April 2024, about 1 year ago

Problem/Motivation

Spotted while working on πŸ“Œ [PP-1] Use cache collector for state Needs work .

CacheCollector contains a method to normalize the lock name before calling acquiring the lock:

    $lock_name = $this->normalizeLockName($cid . ':' . __CLASS__);
    if (!$lock || $this->lock->acquire($lock_name)) {

But this shouldn't be the cache collector's problem, the lock subsystem should deal with that - and it does:

  public function acquire($name, $timeout = 30.0) {
    $name = $this->normalizeName($name);

It turns out that CacheCollector::normalizeLockName() and DatabaseLockBackend::normalizeName() basically do the same thing. CacheCollector::normalizeLockName() predates #2872276: Database lock backend should normalize the lock name β†’ but no followup was created to remove other normalizations.

Steps to reproduce

Proposed resolution

Remove CacheCollector::normalizeLockName().

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
CacheΒ  β†’

Last updated 12 days ago

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024