Отключение ленивых приложений, кажется, решает проблему.< /p>
Мне удалось создать минимальную версию, воспроизводящую проблему:
Код: Выделить всё
[uwsgi]
strict = true
vacuum = true
master = true
die-on-term = true
need-app = true
enable-threads = true
single-interpreter = true
lazy-apps = true
#skip-atexit-teardown = true
wsgi-file=app_api.py
auto-procname = true
procname-prefix-spaced = app
workers = 1
socket = /tmp/app_api.sock
chmod-socket = 664
Код: Выделить всё
import falcon
import atexit
import ssl
def get_app():
def exith():
print('Exiting...')
ctx = ssl.create_default_context()
print(ctx)
atexit.register(exith)
ctx = ssl.create_default_context()
print(ctx)
app = falcon.App()
return app
application = get_app()
Код: Выделить всё
spawned uWSGI master process (pid: 13998)
spawned uWSGI worker 1 (pid: 13999, cores: 1)
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x7374fcf87478 pid: 13999 (default app)
SIGINT/SIGTERM received...killing workers...
Exiting...
Exception ignored in atexit callback:
Traceback (most recent call last):
File "app_api.py", line 9, in exith
ctx = ssl.create_default_context()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ssl.py", line 761, in create_default_context
context = SSLContext(PROTOCOL_TLS_CLIENT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ssl.py", line 500, in __new__
self = _SSLContext.__new__(cls, protocol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLError: unknown error (_ssl.c:3098)
worker 1 buried after 1 seconds
goodbye to uWSGI.
- uWSGI 2.0.28 (64 бит)
- Версия Python: 3.11.11
Подробнее здесь: https://stackoverflow.com/questions/793 ... hon-atexit