-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Most of the functions that are run within the WebSocket endpoint, for example, do not have any timeout or expiry. Particularly in #20 we have:
async def wait_pubsub_subscribe(channel: str, subs: int):
"""Wait for subs number of players to subscribe to channel"""
while True:
if (await redis_client.pubsub_numsub(channel))[0][1] >= subs:
return
await asyncio.sleep(0.01)which may cause an infinite loop if a client disconnects between receving the start message from the host and subscribing to the game:{game_id}:channel channel as the pubsub_numsub would then never equal subs.
We could probably use some sort of asyncio.timeout() to deal with that (if not, rewriting the whole backend to be more fault-tolerant would also be a solution 😅)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels