Issue Feature Under Review

#111404Use symfony/lock for locking and deprecate the legacy locking API

Benni Mack 11/11/26, 07:35 updated 11/11/26, 08:59

Description

TYPO3’s own locking API (LockFactory, LockingStrategyInterface and the File, Semaphore and Simple lock strategies) only works on a single host. Page generation and image processing locks therefore have no effect across several web nodes or containers, the file strategy fails on NFS (#72074), and locks never expire when a worker crashes.

symfony/lock covers the same ground with a well maintained set of stores (flock, semaphore, Redis, Memcached, combined stores, …), lock expiration and non-blocking acquisition.

This change:

  • requires symfony/lock and provides Symfony’s LockFactory as a service, configured through $GLOBALS[‘TYPO3_CONF_VARS’][‘SYS’][‘locking’][‘store’] (a store DSN, defaulting to a file lock in var/lock as before) with optional per-scope overrides in [‘SYS’][‘locking’][‘stores’]
  • rewrites ResourceMutex (page generation, image processing) on top of it, which replaces the access lock plus polling loop with a single lock
  • migrates the remaining Core callers (language pack states, CLI user creation, mbox transport, rotating file log writer)
  • deprecates LockFactory, LockingStrategyInterface, the three strategies, their exceptions and the [‘SYS’][‘locking’][‘strategies’] configuration

Database backed stores, which need a lock table, are not part of this change.

Reviews 1

History 12