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

Namespace GlobalLocks to storage namespaces

Summary:
Currently, multiple unit tests that acquire global locks will interfere with each other. Namespace the locks so they don't.

(Possibly we should also rename this to PhabricatorStorageNamespaceLock or something since it's not really global any more, but that's kind of unwieldy...)

Test Plan: Acquired locks with --trace and verified they were namespaced properly.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1162

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

+6 -1
+6 -1
src/infrastructure/util/PhabricatorGlobalLock.php
··· 35 35 * do_contentious_things(); 36 36 * $lock->unlock(); 37 37 * 38 + * NOTE: This lock is not completely global; it is namespaced to the active 39 + * storage namespace so that unit tests running in separate table namespaces 40 + * are isolated from one another. 41 + * 38 42 * @task construct Constructing Locks 39 43 * @task impl Implementation 40 44 */ ··· 48 52 49 53 50 54 public static function newLock($name) { 51 - $full_name = 'global:'.$name; 55 + $namespace = PhabricatorLiskDAO::getStorageNamespace(); 56 + $full_name = 'global:'.$namespace.':'.$name; 52 57 53 58 $lock = self::getLock($full_name); 54 59 if (!$lock) {