From cbf9ccf062cdbcc3cc98ddf3ca21edd21998566c Mon Sep 17 00:00:00 2001 From: Unbit Date: Wed, 18 Sep 2013 12:03:35 +0200 Subject: [PATCH] more brutal heartbeat emperor management --- core/emperor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/emperor.c b/core/emperor.c index 004da0dc..596ca8a5 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -1521,10 +1521,14 @@ void emperor_loop() { while (ui_current) { if (ui_current->last_heartbeat > 0) { if ((ui_current->last_heartbeat + uwsgi.emperor_heartbeat) < uwsgi_now()) { - uwsgi_log("[emperor] vassal %s sent no heartbeat in last %d seconds, respawning it...\n", ui_current->name, uwsgi.emperor_heartbeat); + uwsgi_log("[emperor] vassal %s sent no heartbeat in last %d seconds, brutally respawning it...\n", ui_current->name, uwsgi.emperor_heartbeat); // set last_heartbeat to 0 avoiding races ui_current->last_heartbeat = 0; - emperor_respawn(ui_current, uwsgi_now()); + if (ui_current->pid > 0) { + if (kill(ui_current->pid, SIGKILL)) { + uwsgi_error("[emperor] kill()"); + } + } } } ui_current = ui_current->ui_next;