From 9fba4fb72af9deff704d7b51fc352d1063717330 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Fri, 17 Jan 2025 12:39:28 -0800 Subject: [PATCH] DEBUG: lock holder for LockExpiredError --- reflex/state.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/reflex/state.py b/reflex/state.py index a31aae032..818fe7455 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -3451,12 +3451,11 @@ class StateManagerRedis(StateManager): RuntimeError: If the state instance doesn't match the state name in the token. """ # Check that we're holding the lock. - if ( - lock_id is not None - and await self.redis.get(self._lock_key(token)) != lock_id - ): + lock_holder = await self.redis.get(self._lock_key(token)) + if lock_id is not None and lock_holder != lock_id: raise LockExpiredError( - f"Lock expired for token {token} while processing. Consider increasing " + f"Lock expired for token {token} while processing. My lock id {lock_id} != {lock_holder}. " + "Consider increasing " f"`app.state_manager.lock_expiration` (currently {self.lock_expiration}) " "or use `@rx.event(background=True)` decorator for long-running tasks." )