From: Michael Vogel Date: Thu, 4 Aug 2016 13:33:15 +0000 (+0200) Subject: Reschedule killed processes at the beginning of the queue. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=074ae59f49ddaae9d699a1e32537cb71c2c7590e;p=friendica.git Reschedule killed processes at the beginning of the queue. --- diff --git a/include/poller.php b/include/poller.php index dfc3b90cf0..578f1424eb 100644 --- a/include/poller.php +++ b/include/poller.php @@ -235,9 +235,10 @@ function poller_kill_stale_workers() { logger("Worker process ".$pid["pid"]." took more than 3 hours. It will be killed now."); posix_kill($pid["pid"], SIGTERM); - // Question: If a process is stale: Should we remove it or should we reschedule it? - // By now we rescheduling it. It's maybe not the wisest decision? - q("UPDATE `workerqueue` SET `executed` = '0000-00-00 00:00:00', `pid` = 0 WHERE `pid` = %d", + // We killed the stale process. + // To avoid a blocking situation we reschedule the process at the beginning of the queue. + q("UPDATE `workerqueue` SET `executed` = '0000-00-00 00:00:00', `created` = '%s', `pid` = 0 WHERE `pid` = %d", + dbesc(datetime_convert()), intval($pid["pid"])); } else logger("Worker process ".$pid["pid"]." now runs for ".round($duration)." minutes. That's okay.", LOGGER_DEBUG);