From f35a36ac02eb115a2f257546d9932b4b3a83a8e7 Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Sun, 5 Jun 2011 07:38:58 +0200 Subject: [PATCH] set a mercy mode for INT/QUIT --- uwsgi.c | 8 ++++++++ uwsgiconfig.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/uwsgi.c b/uwsgi.c index 8419b9bd..3a795b8b 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -408,6 +408,14 @@ void goodbye_cruel_world() { void kill_them_all(int signum) { int i; uwsgi.to_hell = 1; + + if (uwsgi.reload_mercy > 0) { + uwsgi.master_mercy = time(NULL) + uwsgi.reload_mercy; + } + else { + uwsgi.master_mercy = time(NULL) + 5; + } + uwsgi_log("SIGINT/SIGQUIT received...killing workers...\n"); for (i = 1; i <= uwsgi.numproc; i++) { if (uwsgi.workers[i].pid > 0) diff --git a/uwsgiconfig.py b/uwsgiconfig.py index f436409b..a3fe0e75 100644 --- a/uwsgiconfig.py +++ b/uwsgiconfig.py @@ -1,6 +1,6 @@ # uWSGI build system -uwsgi_version = '0.9.8-dev' +uwsgi_version = '0.9.8' import os import re