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'm running this nice server as an asyncio task. I can't really complain about functional things, everything runs so far for me. Version is 0.14.0.
When the server is started and no interaction with some client has happened so far, I can CTRL_C w/o problem. But already with the first REST call and a following CTRL_C this appears on the prompt:
ERROR: Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/starlette/routing.py", line 686, in lifespan
await receive()
File "/home/pi/.local/lib/python3.9/site-packages/uvicorn/lifespan/on.py", line 137, in receive
return await self.receive_queue.get()
File "/usr/lib/python3.9/asyncio/queues.py", line 166, in get
await getter
asyncio.exceptions.CancelledError
If I'm doing more and more things, even Websocket service, the error list can grow rapidly:
ERROR: Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/starlette/routing.py", line 686, in lifespan
await receive()
File "/home/pi/.local/lib/python3.9/site-packages/uvicorn/lifespan/on.py", line 137, in receive
return await self.receive_queue.get()
File "/usr/lib/python3.9/asyncio/queues.py", line 166, in get
await getter
asyncio.exceptions.CancelledError
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 247, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
File "/home/pi/.local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
return await self.app(scope, receive, send)
File "/home/pi/.local/lib/python3.9/site-packages/fastapi/applications.py", line 1106, in __call__
await super().__call__(scope, receive, send)
File "/home/pi/.local/lib/python3.9/site-packages/starlette/applications.py", line 122, in __call__
await self.middleware_stack(scope, receive, send)
File "/home/pi/.local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 149, in __call__
await self.app(scope, receive, send)
File "/home/pi/.local/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "/home/pi/.local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
await self.app(scope, receive, send)
File "/home/pi/.local/lib/python3.9/site-packages/starlette/routing.py", line 718, in __call__
await route.handle(scope, receive, send)
File "/home/pi/.local/lib/python3.9/site-packages/starlette/routing.py", line 341, in handle
await self.app(scope, receive, send)
File "/home/pi/.local/lib/python3.9/site-packages/starlette/routing.py", line 82, in app
await func(session)
File "/home/pi/.local/lib/python3.9/site-packages/fastapi/routing.py", line 325, in app
await dependant.call(**values)
File "/home/pi/test/api.py", line 137, in send_data
# Handle messages received if needed
File "/home/pi/.local/lib/python3.9/site-packages/starlette/websockets.py", line 112, in receive_text
message = await self.receive()
File "/home/pi/.local/lib/python3.9/site-packages/starlette/websockets.py", line 45, in receive
message = await self._receive()
File "/home/pi/.local/lib/python3.9/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 360, in asgi_receive
data = await self.recv()
File "/home/pi/.local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 552, in recv
await asyncio.wait(
File "/usr/lib/python3.9/asyncio/tasks.py", line 413, in wait
return await _wait(fs, timeout, return_when, loop)
File "/usr/lib/python3.9/asyncio/tasks.py", line 529, in _wait
await waiter
asyncio.exceptions.CancelledError
Somewhere on the traceback is also code of mine.
Is it generally a problem to break out from Unicorn services with CTRL_C? Should that be done by maybe intercepting SIGINT and do some more controlled stuff?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm running this nice server as an
asyncio
task. I can't really complain about functional things, everything runs so far for me. Version is 0.14.0.When the server is started and no interaction with some client has happened so far, I can CTRL_C w/o problem. But already with the first REST call and a following CTRL_C this appears on the prompt:
If I'm doing more and more things, even Websocket service, the error list can grow rapidly:
Somewhere on the traceback is also code of mine.
Is it generally a problem to break out from Unicorn services with CTRL_C? Should that be done by maybe intercepting SIGINT and do some more controlled stuff?
Beta Was this translation helpful? Give feedback.
All reactions