From f13637627d65efd68d9158d9a37f4b10b4f080a5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 24 Mar 2017 08:17:08 -0700 Subject: [PATCH] Improve daemon "waiting" message, config reload behavior Summary: Ref T12298. Two minor daemon improvements: - Make the "waiting" message reflect hibernation. - Don't trigger a reload right after launching. Test Plan: - Read "waiting" message. - Ran "bin/phd start", didn't see an immediate SIGHUP in the log. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12298 Differential Revision: https://secure.phabricator.com/D17550 --- .../controller/PhabricatorDaemonLogViewController.php | 10 ++++------ .../overseer/PhabricatorDaemonOverseerModule.php | 6 ++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php index 004ce3a84e..f4c7ba60c9 100644 --- a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php +++ b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php @@ -125,12 +125,10 @@ final class PhabricatorDaemonLogViewController case PhabricatorDaemonLog::STATUS_WAIT: $details = pht( 'This daemon is running normally and reported a status update '. - 'recently (within %s). However, it encountered an error while '. - 'doing work and is waiting a little while (%s) to resume '. - 'processing. After encountering an error, daemons wait before '. - 'resuming work to avoid overloading services.', - phutil_format_relative_time($unknown_time), - phutil_format_relative_time($wait_time)); + 'recently (within %s). The process is currently waiting to '. + 'restart, either because it is hibernating or because it '. + 'encountered an error.', + phutil_format_relative_time($unknown_time)); break; case PhabricatorDaemonLog::STATUS_EXITING: $details = pht('This daemon is shutting down gracefully.'); diff --git a/src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php b/src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php index 608151c348..be5ebec79e 100644 --- a/src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php +++ b/src/infrastructure/daemon/overseer/PhabricatorDaemonOverseerModule.php @@ -48,6 +48,12 @@ final class PhabricatorDaemonOverseerModule $this->configVersion = $new_version; + // Don't trigger a reload if we're loading the config for the very + // first time. + if ($old_version === null) { + return false; + } + return ($old_version != $new_version); }