From 8f7983a5be3a56db5b79dc7c3a0eb470f1d7ca02 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 25 Mar 2017 05:01:32 -0700 Subject: [PATCH] (stable) Only hibernate the Taskmaster after 15 seconds of inactivity Under some workloads, the taskmaster may hibernate and launch more rapidly than it should. Require 15 seconds of inactivity before hibernating. Also hibernate for longer. Auditors: chad --- .../daemon/workers/PhabricatorTaskmasterDaemon.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php index 6cbbd8698e..57a69843a4 100644 --- a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php +++ b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php @@ -44,8 +44,11 @@ final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon { $sleep = 0; } else { - if ($this->shouldHibernate(60)) { - break; + if ($this->getIdleDuration() > 15) { + $hibernate_duration = phutil_units('3 minutes in seconds'); + if ($this->shouldHibernate($hibernate_duration)) { + break; + } } // When there's no work, sleep for one second. The pool will