You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I successfully get a bunch of 'y' in the output. Hovewer, when I interrupt
console (2) to close the connection, the server crashes with following error
await serve_websocket(echo_server, 'localhost', 8000, ssl_context=None)
File "/usr/lib/python3.8/site-packages/trio_websocket-0.8.0-py3.8.egg/trio_websocket/_impl.py", line 374, in serve_websocket
await server.run(task_status=task_status)
File "/usr/lib/python3.8/site-packages/trio_websocket-0.8.0-py3.8.egg/trio_websocket/_impl.py", line 1345, in run
await trio.sleep_forever()
File "/usr/lib/python3.8/site-packages/trio/_core/_run.py", line 730, in __aexit__
raise combined_error_from_nursery
File "/usr/lib/python3.8/site-packages/trio/_highlevel_serve_listeners.py", line 129, in serve_listeners
task_status.started(listeners)
File "/usr/lib/python3.8/site-packages/trio/_core/_run.py", line 730, in __aexit__
raise combined_error_from_nursery
File "/usr/lib/python3.8/site-packages/trio/_highlevel_serve_listeners.py", line 27, in _run_handler
await handler(stream)
File "/usr/lib/python3.8/site-packages/trio_websocket-0.8.0-py3.8.egg/trio_websocket/_impl.py", line 1373, in _handle_connection
await connection.aclose()
File "/usr/lib/python3.8/site-packages/trio/_core/_run.py", line 730, in __aexit__
raise combined_error_from_nursery
File "/usr/lib/python3.8/site-packages/trio_websocket-0.8.0-py3.8.egg/trio_websocket/_impl.py", line 1148, in _reader_task
await handler(event)
File "/usr/lib/python3.8/site-packages/trio_websocket-0.8.0-py3.8.egg/trio_websocket/_impl.py", line 1071, in _handle_message_event
await self._send_channel.send(msg)
File "/usr/lib/python3.8/site-packages/trio/_channel.py", line 174, in send
await trio.hazmat.wait_task_rescheduled(abort_fn)
File "/usr/lib/python3.8/site-packages/trio/_core/_traps.py", line 165, in wait_task_rescheduled
return (await _async_yield(WaitTaskRescheduled(abort_func))).unwrap()
File "/usr/lib/python3.8/site-packages/outcome/_sync.py", line 111, in unwrap
raise captured_error
trio.ClosedResourceError
I don't get any errors if I just use websocat and type messages by hand.
versions
~/s/l/p/tests [legimens]× » python --version
Python 3.8.2
~/s/l/p/tests [legimens]× » pip show trio-websocket
Name: trio-websocket
Version: 0.8.0
[...]
~/s/l/p/tests [legimens]× » uname -a
Linux archlinux 5.5.13-arch2-1 #1 SMP PREEMPT Mon, 30 Mar 2020 20:42:41 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
I've been trying to debug this error as well - at first I thought it was my own code, but it seems to be easy to trigger when closing a connection from the client side while the server has a pending write.
nmichaud
added a commit
to nmichaud/trio-websocket
that referenced
this issue
Sep 21, 2020
Hello!
what I do
I use simple server example from here https://trio-websocket.readthedocs.io/en/stable/servers.html
and try to test how fast can it get. I use server code from that page just with added print line.
in one console I do
python test_server.py
In another console (2) i do
yes | pv | websocat ws://localhost:8000 >dev/null
where websocat is a handy cli tool for websocket https://github.com/vi/websocat.
what I get
I successfully get a bunch of 'y' in the output. Hovewer, when I interrupt
console (2) to close the connection, the server crashes with following error
I don't get any errors if I just use
websocat
and type messages by hand.versions
The text was updated successfully, but these errors were encountered: