Maybe BUG? The wsproto
backend didn't raise exception
for unexpected client disconnection, however websockets
do.
#2137
Unanswered
WSH032
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When the client disconnects without sending a close frame, Starlette is unable to perceive it, even if
websocket.send
_text has already been called.wsproto
backend,webSockets
, it raises an exception.It is a bit similar to starlette/issues/759, but maybe more unsettling,
because it's a reasonable functionality for the server to only send messages to the client without receiving any from the client.
However, the client can use this bug to infinitely create isolated asynchronous tasks, consuming server resources.
To reproduce this issue:
Server
client connect
ws
and suddenly shutdownThen, launch
wsproto
you will get infinite:
If
websockets
, it will be good:Beta Was this translation helpful? Give feedback.
All reactions