unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.46k stars 691 forks source link

Check uwsgi configuration before restarting like apache does #1104

Open KES777 opened 9 years ago

KES777 commented 9 years ago

When we restart server and configuration is not OK the server will down until we fix configuration. That is wrong behaviour and does not follow zero time down. Detail info here

You can see that server is going down and do not up...

Wed Nov  4 11:23:50 2015 - *** /etc/uwsgi/apps-enabled/geekbrains.ini has been touched... grace them all !!! ***
Wed Nov  4 11:23:50 2015 - ...gracefully killing workers...
Wed Nov  4 11:23:50 2015 - Gracefully killing worker 1 (pid: 10761)...
unbit commented 9 years ago

Do you have some idea on how to accomplish this ? uWSGI configuration system is not linear (it is more like a language). The --fallback-config option seems currently the safest and easiest way to reduce this kind of problems (albeit not perfect)

KES777 commented 9 years ago

run second instance of uwsgi before killing master. The second instance do all the same as normal start except do not bind to port and do not write any log messages. Then you check exit code. If it is OK then you can kill current and start new.

unbit commented 9 years ago

@KES777 well at this point --fallback-config gives you the same reliability without the need for generating a whole new stack and changing the code paths (that is an hard task)