From bae328efa19126e35d2a8523b5e48a6901d99151 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Thu, 30 Apr 2026 07:42:59 +0100 Subject: [PATCH] revert: keep narrow RedisException catch on lock acquire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/Appwrite/Locking/Lock.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Locking/Lock.php b/src/Appwrite/Locking/Lock.php index 38e034b220..6390a4a4be 100644 --- a/src/Appwrite/Locking/Lock.php +++ b/src/Appwrite/Locking/Lock.php @@ -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);