revert: keep narrow RedisException catch on lock acquire

Reverts the catch widening from earlier — the underlying
Utopia\Lock\Distributed::tryAcquire only calls ext-redis methods,
which throw RedisException exclusively. Catching Throwable was
over-broad and would silently swallow real bugs (TypeError, Error)
into a fail-open path.
This commit is contained in:
Prem Palanisamy
2026-04-30 07:42:59 +01:00
parent 03575e68c4
commit bae328efa1
+1 -1
View File
@@ -129,7 +129,7 @@ final class Lock
try {
$acquired = $orFail ? $lock->acquire($waitTimeout) : $lock->tryAcquire();
} catch (Throwable $e) {
} catch (\RedisException $e) {
$this->attempts->add(1, ['outcome' => 'backend_error', ...$labels]);
$this->reportError('backend_error', $key, $target, $e);