From d138b118689d42ae20f6c12cc49e30385d88ea2e Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 8 Aug 2016 21:28:44 +0200 Subject: [PATCH] Use a 10 minute timeout for high priority processes. This may be better. --- include/poller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/poller.php b/include/poller.php index d838df7797..ecdb9eb0d3 100644 --- a/include/poller.php +++ b/include/poller.php @@ -217,7 +217,7 @@ function poller_max_connections_reached() { * */ function poller_kill_stale_workers() { - $r = q("SELECT `pid`, `executed`, `priority` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'"); + $r = q("SELECT `pid`, `executed`, `priority`, `parameter` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'"); if (!dbm::is_result($r)) { // No processing here needed @@ -236,13 +236,13 @@ function poller_kill_stale_workers() { $pid["priority"] = PRIORITY_MEDIUM; // Define the maximum durations - $max_duration_defaults = array(PRIORITY_SYSTEM => 360, PRIORITY_HIGH => 5, PRIORITY_MEDIUM => 60, PRIORITY_LOW => 180); + $max_duration_defaults = array(PRIORITY_SYSTEM => 360, PRIORITY_HIGH => 10, PRIORITY_MEDIUM => 60, PRIORITY_LOW => 180); $max_duration = $max_duration_defaults[$pid["priority"]]; // How long is the process already running? $duration = (time() - strtotime($pid["executed"])) / 60; if ($duration > $max_duration) { - logger("Worker process ".$pid["pid"]." took more than ".$max_duration." minutes. It will be killed now."); + logger("Worker process ".$pid["pid"]." (".$pid["parameter"].") took more than ".$max_duration." minutes. It will be killed now."); posix_kill($pid["pid"], SIGTERM); // We killed the stale process.