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

Parameterize the repository read and write locks

Summary:
Ref T13202. See PHI889. Update the read and write locks to the modern parameterized verison, which handles hashing/normalization and can store better logs.

This parameterized mode was added in D19173 and has been used successfully for some time, but not all locks have switched over to it yet.

Test Plan:
- Added an `fprintf(STDERR, $full_name)` to the lock code.
- Pulled a repository.
- Saw sensible lock name on stdout before "acquired read lock...".
- Additional changes in this patch series will vet this more completely.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13202

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

+9 -7
+9 -7
src/applications/repository/storage/PhabricatorRepositoryWorkingCopyVersion.php
··· 76 76 77 77 78 78 public static function getReadLock($repository_phid, $device_phid) { 79 - $repository_hash = PhabricatorHash::digestForIndex($repository_phid); 80 - $device_hash = PhabricatorHash::digestForIndex($device_phid); 81 - $lock_key = "repo.read({$repository_hash}, {$device_hash})"; 79 + $parameters = array( 80 + 'repositoryPHID' => $repository_phid, 81 + 'devicePHID' => $device_phid, 82 + ); 82 83 83 - return PhabricatorGlobalLock::newLock($lock_key); 84 + return PhabricatorGlobalLock::newLock('repo.read', $parameters); 84 85 } 85 86 86 87 public static function getWriteLock($repository_phid) { 87 - $repository_hash = PhabricatorHash::digestForIndex($repository_phid); 88 - $lock_key = "repo.write({$repository_hash})"; 88 + $parameters = array( 89 + 'repositoryPHID' => $repository_phid, 90 + ); 89 91 90 - return PhabricatorGlobalLock::newLock($lock_key); 92 + return PhabricatorGlobalLock::newLock('repo.write', $parameters); 91 93 } 92 94 93 95