Handle WebSocket client disconnect during prepare (#124173)
This commit is contained in:
parent
fc767ee562
commit
108a54a4a8
2 changed files with 27 additions and 2 deletions
|
@ -306,6 +306,13 @@ class WebSocketHandler:
|
|||
try:
|
||||
async with asyncio.timeout(10):
|
||||
await wsock.prepare(request)
|
||||
except ConnectionResetError:
|
||||
# Likely the client disconnected before we prepared the websocket
|
||||
logger.debug(
|
||||
"%s: Connection reset by peer while preparing WebSocket",
|
||||
self.description,
|
||||
)
|
||||
return wsock
|
||||
except TimeoutError:
|
||||
logger.warning("Timeout preparing request from %s", request.remote)
|
||||
return wsock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue