@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow the Fact daemon to hibernate

Summary:
A handful of Phacility production shards have run into memory pressure issues recently. Although there's no smoking gun, and at least two other plausible contributors, one possible concern is that the Fact daemon was written before hibernation and can not currently hibernate. Even if there's no memory leak, this creates unnecessary memory pressure by holding the processes in memory.

Allow the Fact daemon to hibernate, like other daemons do.

Test Plan: Ran "bin/phd debug fact", saw the Fact daemon hibernate.

Subscribers: yelirekim

Differential Revision: https://secure.phabricator.com/D21389

+9 -4
+9 -4
src/applications/fact/daemon/PhabricatorFactDaemon.php
··· 6 6 7 7 protected function run() { 8 8 $this->setEngines(PhabricatorFactEngine::loadAllEngines()); 9 - while (!$this->shouldExit()) { 9 + do { 10 10 PhabricatorCaches::destroyRequestCache(); 11 11 12 12 $iterators = $this->getAllApplicationIterators(); ··· 14 14 $this->processIteratorWithCursor($iterator_name, $iterator); 15 15 } 16 16 17 - $this->log(pht('Zzz...')); 18 - $this->sleep(15); 19 - } 17 + $sleep_duration = 60; 18 + 19 + if ($this->shouldHibernate($sleep_duration)) { 20 + break; 21 + } 22 + 23 + $this->sleep($sleep_duration); 24 + } while (!$this->shouldExit()); 20 25 } 21 26 22 27 public static function getAllApplicationIterators() {