我正在运行uwsgi(在docker容器中带有django),并且产生的每个工作程序都会出现此错误:
spawned uWSGI master process (pid: 1)
web_1 | spawned uWSGI worker 1 (pid: 18, cores: 2)
web_1 | Exception ignored in: <function _after_at_fork_child_reinit_locks at 0x7fd944954ca0>
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/logging/__init__.py", line 260, in _after_at_fork_child_reinit_locks
web_1 | spawned uWSGI worker 2 (pid: 19, cores: 2)
web_1 | _releaseLock() # Acquired by os.register_at_fork(before=.
web_1 | File "/usr/local/lib/python3.8/logging/__init__.py", line 228, in _releaseLock
web_1 | _lock.release()
web_1 | RuntimeError: cannot release un-acquired lock
这是我的uwsgi .ini 文件:
[uwsgi]
strict = true ; only explicitly understood configration allowed
module = myapp.wsgi
need-app = true ; don't start if can't find or load django app
### PROCESS SETTINGS ###############
master = true ; gracefully re-spawn and pre-fork workers, consolidate logs, etc
enable-threads = true
processes = 10 ; maximum number of worker processes
threads = 2
thunder-lock = true
socket = 0.0.0.0:8000 ; too complicated for me to get a unix socket to work with docker, this is fine.
#socket = /tmp/myapp.sock
vacuum = true ; on exit, clean up any temporary files or UNIX sockets it created, such as HTTP sockets, pidfiles, or admin FIFOs
single-interpreter = true
die-on-term = true
### WORKER MANAGEMENT ##########
max-requests = 1000 ; Restart workers after this many requests
max-worker-lifetime = 3600 ; Restart workers after this many seconds
reload-on-rss = 2048 ; Restart workers after this much resident memory
worker-reload-mercy = 60 ; How long to wait before forcefully killing workers
harakiri = 60 ; Forcefully kill workers after 60 seconds
py-call-osafterfork = true ; Allow workers to receive signals such as signal.alarm
### LOGGING ####################
disable-logging = true ; Disable built-in logging
log-4xx = true ; but log 4xx's anyway
log-5xx = true ; and 5xx's
#log-to = /var/log/uwsgi.uwsgi.log
我该如何解决?我会丢失包裹吗?
我的Docker文件使用python:3.8-slim
,但在3.7-slim
Dockerfile 个软件包:
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1
# Install git, process tools, lsb-release (common in install instructions for CLIs)
RUN apt-get install -y git procps lsb-release
# Required for psycopg2: https://github.com/psycopg/psycopg2/issues/699
RUN apt-get install -y --no-install-recommends libpq-dev
# Install any missing dependencies for enhanced language service
RUN apt-get install -y libicu[0-9][0-9]
# Install uwsgi
RUN apt-get install -y build-essential
RUN pip install uwsgi
答案 0 :(得分:3)
尝试删除"LOG_ID" "LOG_DATE" "JOB_NAME" "JOB_SUBNAME" "STATUS" "ERROR#" "ACTUAL_START_DATE" "RUN_DURATION"
"1548" "14-JUN-20 12.15.46.744612000 AM -04:00" "TEST_JOB" "CHAIN_STEP3" "SUCCEEDED" "0" "14-JUN-20 12.15.41.708043000 AM AMERICA/NEW_YORK" "+00 00:00:05.000000"
"1544" "14-JUN-20 12.15.46.746544000 AM -04:00" "TEST_JOB" "CHAIN_STEP2" "SUCCEEDED" "0" "14-JUN-20 12.15.41.690404000 AM AMERICA/NEW_YORK" "+00 00:00:05.000000"
"1546" "14-JUN-20 12.15.46.748830000 AM -04:00" "TEST_JOB" "CHAIN_STEP1" "SUCCEEDED" "0" "14-JUN-20 12.15.41.690891000 AM AMERICA/NEW_YORK" "+00 00:00:05.000000"
"1550" "14-JUN-20 12.15.46.968592000 AM -04:00" "TEST_JOB" "" "SUCCEEDED" "0" "14-JUN-20 12.15.41.574115000 AM AMERICA/NEW_YORK" "+00 00:00:05.000000"
uwsgi配置选项。