Handshaking may not be completed yet at `shutdown` in wsproto impl
See original GitHub issueTraceback:
LocalProtocolError: Event CloseConnection(code=1012, reason=None) cannot be sent during the handshake
File "gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "uvicorn/workers.py", line 57, in init_process
super(UvicornWorker, self).init_process()
File "gunicorn/workers/base.py", line 140, in init_process
self.run()
File "uvicorn/workers.py", line 66, in run
loop.run_until_complete(server.serve(sockets=self.sockets))
File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
File "uvicorn/main.py", line 403, in serve
await self.shutdown(sockets=sockets)
File "uvicorn/main.py", line 539, in shutdown
connection.shutdown()
File "uvicorn/protocols/websockets/wsproto_impl.py", line 115, in shutdown
output = self.conn.send(wsproto.events.CloseConnection(code=1012))
File "__init__.py", line 61, in send
data += self.handshake.send(event)
File "wsproto/handshake.py", line 101, in send
"Event {} cannot be sent during the handshake".format(event)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
RFC 6455: The WebSocket Protocol
1. If the connection is happening on an HTTPS (HTTP-over-TLS) port, perform a TLS handshake over the connection. · 2. The server can...
Read more >uvicorn - Bountysource
0 likes. uvicorn eats SIGINTs, does not propagate exceptions paid out closed ; 0 likes. Handshaking may not be completed yet at `shutdown`...
Read more >ASGI Documentation
chronous apps, with a WSGI backwards-compatibility implementation and ... multiple incoming events (like receiving WebSocket frames) can't trigger this.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
on a side note thanks for websocat, it rocks
This didn’t get fixe by #704 — I was able to reproduce against this sample app:
After connecting the client I go ahead and shut down the server with
Ctrl+C
, reproducing the error: