Skip to content

Commit

Permalink
fix aiohttp hang when disconnectinf ws clients
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Nov 5, 2020
1 parent 716bbe0 commit 55d9d4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions molior/backends/http/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async def watchdog(ws_client):
if hasattr(ws_client, "molior_pong_pending") and ws_client.molior_pong_pending == 1:
logger.warn("backend: ping timeout after %ds on %s/%s",
PING_TIMEOUT, ws_client.molior_node_arch, ws_client.molior_node_name)
await ws_client.close()
await deregister_node(ws_client)
# await ws_client.close()
break

# send ping
Expand All @@ -46,7 +46,7 @@ async def watchdog(ws_client):

except Exception as exc:
logger.exception(exc)
await ws_client.close()
# await ws_client.close()


@app.websocket_connect(group="registry")
Expand All @@ -56,7 +56,7 @@ async def node_register(ws_client):

if arch not in registry:
logger.error("backend: invalid architecture received: '%s'", arch)
await ws_client.close()
# await ws_client.close()
return ws_client

# initialize
Expand Down

0 comments on commit 55d9d4d

Please sign in to comment.