From d9a04fcb5342f50bae2732af5b06258909173cb1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 22 Dec 2013 08:51:07 -0800 Subject: [PATCH] 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: Auditors: btrahan --- .../daemon/PhabricatorRepositoryPullLocalDaemon.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php index 62cb4eeb3f..9dc67a0bd0 100644 --- a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php +++ b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php @@ -144,11 +144,10 @@ final class PhabricatorRepositoryPullLocalDaemon $lock = PhabricatorGlobalLock::newLock($lock_name); $lock->lock(); - $repository->writeStatusMessage( - PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE, - null); - try { + $repository->writeStatusMessage( + PhabricatorRepositoryStatusMessage::TYPE_NEEDS_UPDATE, + null); $this->discoverRepository($repository); $repository->writeStatusMessage( PhabricatorRepositoryStatusMessage::TYPE_FETCH,