For example sending TTIN signal kill -TTIN $master_pid does nothing as well as CTRL+C does not interrupt the server, only kills the workers. Is there a reason these commands do not work with --preload flag? Without the flag gunicorn functionality works (signals, ctrl+c) without any problem. Maybe there is a problem with Flask application and not in Gunicorn?
The whole idea behind usage of --preload flag in my case is the scheduler that I use in Flask application. I need to run some tasks in background but if I spawn more than one worker, the code gets forked and executed multiple times across each worker. In my mind when using --preload flag, the scheduler gets initialized and AFTER that workers get forked. With --preload flag scheduler works as expected with multiple workers but I am stuck with original problem (ignoring signals, etc.)
When running gunicorn with
--preload
flag, the running master worker ignores signals (TTIN, TTOUT, HUP, etc).For example sending TTIN signal
kill -TTIN $master_pid
does nothing as well as CTRL+C does not interrupt the server, only kills the workers. Is there a reason these commands do not work with --preload flag? Without the flag gunicorn functionality works (signals, ctrl+c) without any problem. Maybe there is a problem with Flask application and not in Gunicorn?The whole idea behind usage of --preload flag in my case is the scheduler that I use in Flask application. I need to run some tasks in background but if I spawn more than one worker, the code gets forked and executed multiple times across each worker. In my mind when using --preload flag, the scheduler gets initialized and AFTER that workers get forked. With --preload flag scheduler works as expected with multiple workers but I am stuck with original problem (ignoring signals, etc.)