You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidgracefully_kill(intsignum) {
uwsgi_log("Gracefully killing worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid);
uwsgi.workers[uwsgi.mywid].manage_next_request=0;
if (uwsgi.threads>1) {
// Stop event_queue_wait() in other threads.// We use loop_stop_pipe only in threaded workers to avoid// unintensional behavior changes in single threaded workers.intfd;
if ((fd=uwsgi.loop_stop_pipe[1]) >0) {
close(fd);
uwsgi.loop_stop_pipe[1] =0;
}
return;
}
// still not found a way to gracefully reload in async modeif (uwsgi.async>0) {
if (uwsgi.workers[uwsgi.mywid].shutdown_sockets)
uwsgi_shutdown_all_sockets();
exit(UWSGI_RELOAD_CODE);
}
if (!uwsgi.workers[uwsgi.mywid].cores[0].in_request) {
if (uwsgi.workers[uwsgi.mywid].shutdown_sockets)
uwsgi_shutdown_all_sockets();
exit(UWSGI_RELOAD_CODE);
}
}
uwsgi.workers[uwsgi.mywid].manage_next_request = 0; make worker not to deal with request in queue.While all workers exit, those requests left in listen queue are all discarded,and this will lead to nginx 502 error.What is the reason for this design?
The text was updated successfully, but these errors were encountered:
uwsgi.workers[uwsgi.mywid].manage_next_request = 0;
make worker not to deal with request in queue.While all workers exit, those requests left in listen queue are all discarded,and this will lead to nginx 502 error.What is the reason for this design?The text was updated successfully, but these errors were encountered: