@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.

Change lock in PullLocalDaemon to only lock on discovery

Summary:
The locks held by read-only pullLocal daemons were causing our discovery instance
to not get the lock and fail at discovery. We don't need to hold the lock while
pulling (only while discovering), so this moves the lock to the appropriate place.

Test Plan: tested in production

Reviewers: jungejason, epriestley, vrana

Reviewed By: jungejason

CC: aran, Korvin

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

+6 -6
+6 -6
src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
··· 136 136 $callsign = $repository->getCallsign(); 137 137 $this->log("Updating repository '{$callsign}'."); 138 138 139 - $lock_name = get_class($this).':'.$callsign; 140 - $lock = PhabricatorGlobalLock::newLock($lock_name); 141 - $lock->lock(); 142 - 143 139 $this->pullRepository($repository); 144 140 145 141 if (!$no_discovery) { 142 + $lock_name = get_class($this).':'.$callsign; 143 + $lock = PhabricatorGlobalLock::newLock($lock_name); 144 + $lock->lock(); 145 + 146 146 // TODO: It would be nice to discover only if we pulled something, 147 147 // but this isn't totally trivial. 148 148 $this->discoverRepository($repository); 149 - } 150 149 151 - $lock->unlock(); 150 + $lock->unlock(); 151 + } 152 152 153 153 $sleep_for = $repository->getDetail('pull-frequency', $min_sleep); 154 154 $retry_after[$id] = time() + $sleep_for;