There is a deadlock situation in sdk/python/packages/flet/src/flet/fastapi/flet_app_manager.py
The following code is locked with a non-recursive lock.
async def __evict_expired_oauth_states(self):
while True:
await asyncio.sleep(10)
with self.__states_lock:
ids = []
for id, state in self.__states.items():
if (
state.expires_at
and datetime.now(timezone.utc) > state.expires_at
):
ids.append(id)
for id in ids:
logger.info(f"Delete expired oauth state: {id}")
self.retrieve_state(id)
However, the self.retrieve_state(id) call locks the code again. As the lock is non-recursive, the code dead-locks at this point. You need to either make the lock recursive(RLock() instead of Lock()), or create an internal unprotected version of retrieve_state, which can be called under locking from the public retrieve_state.
There is a deadlock situation in sdk/python/packages/flet/src/flet/fastapi/flet_app_manager.py The following code is locked with a non-recursive lock.
However, the self.retrieve_state(id) call locks the code again. As the lock is non-recursive, the code dead-locks at this point. You need to either make the lock recursive(RLock() instead of Lock()), or create an internal unprotected version of retrieve_state, which can be called under locking from the public retrieve_state.