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 am running a FastAPI (which is based on starlette) with Gunicorn+uvicorn stack, the worker process sometimes quits over SystemExit and the traceback is like:
SystemExit: 1
File "asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "uvloop/loop.pyx", line 1511, in uvloop.loop.Loop.run_until_complete
File "uvloop/loop.pyx", line 1504, in uvloop.loop.Loop.run_until_complete
File "uvloop/loop.pyx", line 1377, in uvloop.loop.Loop.run_forever
File "uvloop/loop.pyx", line 555, in uvloop.loop.Loop._run
File "uvloop/handles/poll.pyx", line 216, in uvloop.loop.__on_uvpoll_event
File "uvloop/cbhandles.pyx", line 83, in uvloop.loop.Handle._run
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "uvloop/loop.pyx", line 397, in uvloop.loop.Loop._read_from_self
File "uvloop/loop.pyx", line 402, in uvloop.loop.Loop._invoke_signals
File "uvloop/loop.pyx", line 377, in uvloop.loop.Loop._ceval_process_signals
File "gunicorn/workers/base.py", line 199, in handle_abort
sys.exit(1)
CancelledError: null
File "uvicorn/protocols/http/httptools_impl.py", line 426, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "uvicorn/middleware/proxy_headers.py", line 84, in __call__
return await self.app(scope, receive, send)
File "fastapi/applications.py", line 1106, in __call__
await super().__call__(scope, receive, send)
File "starlette/applications.py", line 122, in __call__
await self.middleware_stack(scope, receive, send)
File "starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "fastapi/middleware/asyncexitstack.py", line 17, in __call__
await self.app(scope, receive, send)
File "starlette/routing.py", line 718, in __call__
await route.handle(scope, receive, send)
File "starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "starlette/routing.py", line 69, in app
await response(scope, receive, send)
File "starlette/responses.py", line 277, in __call__
await wrap(partial(self.listen_for_disconnect, receive))
File "starlette/responses.py", line 273, in wrap
await func()
File "starlette/responses.py", line 250, in listen_for_disconnect
message = await receive()
File "uvicorn/protocols/http/httptools_impl.py", line 587, in receive
await self.message_event.wait()
File "asyncio/locks.py", line 309, in wait
await fut
The errors aren't that helpful. I suspect there's some blocking code hidden somewhere caused this. Is there a way to show what requests are been handled when worker timeout happens? Can we dump the URL before SystemExit? Thanks!
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
-
Hello,
I am running a FastAPI (which is based on starlette) with Gunicorn+uvicorn stack, the worker process sometimes quits over
SystemExit
and the traceback is like:The errors aren't that helpful. I suspect there's some blocking code hidden somewhere caused this. Is there a way to show what requests are been handled when worker timeout happens? Can we dump the URL before SystemExit? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions