-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review graceful shutdown #1557
Comments
Here is an example if I start the server and send a
|
Got it: we are just not logging what is going on. This has to do with config_uvicorn_loggers()
logger.info("End application startup")
reset_logger_handlers(logger)
yield
logger = get_logger("fractal_server.lifespan")
logger.info("Start application shutdown") Since we have a reset-handlers call, the next time we call get-logger there are no associated handlers. A quick switch to
|
The missing logs are now included - as of #1569 |
Today I observed a If I re-add the worker class, I cannot always reproduce the error. This is part of the error stack self.error_log.error(msg, *args, **kwargs)
File "/usr/lib/python3.10/logging/__init__.py", line 1506, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/lib/python3.10/logging/__init__.py", line 1624, in _log
self.handle(record)
File "/usr/lib/python3.10/logging/__init__.py", line 1634, in handle
self.callHandlers(record)
File "/usr/lib/python3.10/logging/__init__.py", line 1696, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.10/logging/__init__.py", line 968, in handle
self.emit(record)
File "/usr/lib/python3.10/logging/__init__.py", line 1218, in emit
StreamHandler.emit(self, record)
File "/usr/lib/python3.10/logging/__init__.py", line 1108, in emit
self.handleError(record)
File "/usr/lib/python3.10/logging/__init__.py", line 1021, in handleError
sys.stderr.write('--- Logging error ---\n')
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>
Call stack:
File "/somewhere/venv/bin/gunicorn", line 8, in <module>
sys.exit(run())
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]", prog=prog).run()
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 236, in run
super().run()
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 224, in run
handler()
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 261, in handle_int
self.stop(False)
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 396, in stop
time.sleep(0.1)
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
self.reap_workers()
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 554, in reap_workers
self.log.error(msg)
File "/somewhere/venv/lib/python3.10/site-packages/gunicorn/glogging.py", line 272, in error
self.error_log.error(msg, *args, **kwargs)
Message: 'Worker (pid:192744) was sent SIGINT!' |
I'm not sure that #1547 is working as expected, for a server running as
Let's review it in a real-life example.
The text was updated successfully, but these errors were encountered: