1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 09:20:58 +01:00

Minor, make sure we release locks in pull daemon if we fail in unusual ways

Summary: A user is reporting a re-lock in this daemon, which I can't
reproduce, but might be possible if this throws. Stop it from throwing in
a way which evades unlock.

See: <https://github.com/facebook/phabricator/issues/476>

Auditors: btrahan
This commit is contained in:
epriestley 2013-12-22 08:51:07 -08:00
parent 54a0dd8139
commit d9a04fcb53

View file

@ -144,11 +144,10 @@ final class PhabricatorRepositoryPullLocalDaemon
$lock = PhabricatorGlobalLock::newLock($lock_name); $lock = PhabricatorGlobalLock::newLock($lock_name);
$lock->lock(); $lock->lock();
try {
$repository->writeStatusMessage( $repository->writeStatusMessage(
PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE, PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE,
null); null);
try {
$this->discoverRepository($repository); $this->discoverRepository($repository);
$repository->writeStatusMessage( $repository->writeStatusMessage(
PhabricatorRepositoryStatusMessage::TYPE_FETCH, PhabricatorRepositoryStatusMessage::TYPE_FETCH,