gunicorn not fully reloading after an HUP signal

Solution 1:

The problem is the --preload parameter.

The first solution is not to use the --preload.

The second solution is to follow this:

# Reload a new master with new workers
kill -s USR2 $PID
# Graceful stop old workers
kill -s WINCH $OLDPID
# Graceful stop old master
kill -s QUIT $OLDPID

The third solution is to use the package https://github.com/flupke/rainbow-saddle that works well with supervisord.