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
This is using the subscription example.
When searching I didn't see that the event loop was closed either but I'm not an async expert.
INFO: Started server process [86447]
INFO: Waiting for application startup.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: ('127.0.0.1', 61918) - "GET / HTTP/1.1" 200
INFO: ('127.0.0.1', 61920) - "WebSocket /subscriptions" [accepted]
INFO: ('127.0.0.1', 61918) - "POST / HTTP/1.1" 200
^CINFO: Shutting down
INFO: Waiting for application shutdown.
INFO: Finished server process [86447]
ERROR: Task exception was never retrieved
future: <Task finished coro=<GraphQLWSProtocol._main() done, defined at ./tartiflette_starlette/subscriptions/protocol.py:99> exception=RuntimeError("Unexpected ASGI message 'websocket.send', after sending 'websocket.close'.")>
Traceback (most recent call last):
File "./tartiflette_starlette/subscriptions/protocol.py", line 58, in _subscribe
async for item in stream:
concurrent.futures._base.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./tartiflette_starlette/subscriptions/protocol.py", line 119, in _main
await handler(opid=opid, payload=payload)
File "./tartiflette_starlette/subscriptions/protocol.py", line 89, in _on_start
await self._subscribe(opid, payload)
File "./tartiflette_starlette/subscriptions/protocol.py", line 63, in _subscribe
await self._send_error(Exception("Internal error"), opid=opid)
File "./tartiflette_starlette/subscriptions/protocol.py", line 51, in _send_error
await self._send_message(opid, error_type, {"message": str(exception)})
File "./tartiflette_starlette/subscriptions/protocol.py", line 41, in _send_message
await self.send_json(message)
File "./tartiflette_starlette/subscriptions/impl.py", line 31, in send_json
await self.websocket.send_json(message)
File "/X/tartiflette-asgi/venv/lib/python3.7/site-packages/starlette/websockets.py", line 116, in send_json
await self.send({"type": "websocket.send", "text": text})
File "/X/tartiflette-asgi/venv/lib/python3.7/site-packages/starlette/websockets.py", line 68, in send
await self._send(message)
File "/X/tartiflette-asgi/venv/lib/python3.7/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 218, in asgi_send
raise RuntimeError(msg % message_type)
RuntimeError: Unexpected ASGI message 'websocket.send', after sending 'websocket.close'.
The text was updated successfully, but these errors were encountered:
My bad. Was in the middle of writing this but had to run. Those steps are correct. I've been able to trigger that by shutting the server down in the middle of the subscription as well as hitting the play button again in the middle of the subscription running.
I think a good first step to resolving this would be to add a failing test case. Not sure yet how this can be reproduced programmatically, but I think the idea of "launching a new subscription seems to cancel the previous one and crash it" seems like a good starting point.
This is using the subscription example.
When searching I didn't see that the event loop was closed either but I'm not an async expert.
The text was updated successfully, but these errors were encountered: