Supervisor / supervisor

Supervisor process control system for Unix (supervisord)
http://supervisord.org
Other
8.46k stars 1.24k forks source link

Suppress or handle: Uncaught signal: 13, pid=3, tid=3, fault_addr=0. #1599

Open piotrekkr opened 1 year ago

piotrekkr commented 1 year ago

Hello. I'm using supervisor with nginx and php-fpm, all packed in one docker container and deployed to GCP Cloud Run.

supervisord config /etc/supervisor/supervisord.conf:

[supervisord]
loglevel=warn
logfile=/proc/self/fd/1
logfile_maxbytes = 0
nodaemon=true
user=root
pidfile=/var/run/supervisord.pid

[include]
files=conf.d/*.conf

[unix_http_server]
file=/tmp/supervisor.sock
username = dummy
password = dummy

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
username = dummy
password = dummy

Program configs /etc/supervisor/conf.d/app.conf:

[program:php-fpm]
command=/usr/local/sbin/php-fpm
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
loglevel=debug

[program:nginx]
command=/usr/local/bin/wait-for-php-and-run-nginx.sh
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
loglevel=debug

entrypoint:

echo "[INFO] Executing container command"

exec "$@"

Docker command:

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

CMD [ "supervisord", "-c", "/etc/supervisor/supervisord.conf" ]

Even tho all works fine, I keep getting those errors in cloud run logs:

Uncaught signal: 13, pid=3, tid=3, fault_addr=0.

This probably happens because cloud run is closing unneeded app instances when scaling but I'm not sure. Also, based on https://man7.org/linux/man-pages/man7/signal.7.html , signal 13 seems to be SIGPIPE which is weird.

Is there a way to suppress those error logs in supervisor or maybe to handle them somehow so they will not show as errors?

Thank you.