From 46eafeaa58ae649f00a7d5265c15665ea90355d4 Mon Sep 17 00:00:00 2001 From: Unbit Date: Tue, 12 Feb 2013 18:47:53 +0100 Subject: [PATCH] graceful reload is working again --- core/master.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/master.c b/core/master.c index 67b7be83..9e8a14c9 100644 --- a/core/master.c +++ b/core/master.c @@ -846,6 +846,12 @@ next: // only to be safe :P uwsgi.workers[uwsgi.mywid].harakiri = 0; + // ok, if we are reloading or dying, just continue the master loop + // as soon as all of the workers have pid == 0, the action (exit, or reload) is triggered + if (uwsgi_instance_is_reloading || uwsgi_instance_is_dying) { + continue; + } + // if we are stopping workers, just end here if (WIFEXITED(waitpid_status) && WEXITSTATUS(waitpid_status) == UWSGI_FAILED_APP_CODE) {