1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-09 06:11:01 +01:00
phorge-phorge/src/infrastructure
epriestley 1089a48d4a Allow edges to be configured to prevent cycles
Summary:
Certain types of things we should be storing in edges (notably, Task X depends on Task Y) should always be acyclic. Allow `PhabricatorEdgeEditor` to enforce this, since we can't correctly enforce it outside of the editor without being vulnerable to races.

Each edge type can be marked acyclic. If an edge type is acyclic, we perform additional steps when writing new edges of that type:

  - We acquire a global lock on the edge type before performing any reads or writes. This ensures we can't produce a cycle as a result of a race where two edits add edges which independently do not produce a cycle, but do produce a cycle when combined.
  - After performing writes but before committing transactions, we load the edge graph for each acyclic type and verify that it is, in fact, acyclic. If we detect cycles, we abort the edit.
  - When we're done, we release the edge type locks.

This is a relatively high-complexity change, but gives us a simple way to flag an edge type as acyclic in a robust way.

Test Plan: Ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1162

Differential Revision: https://secure.phabricator.com/D2940
2012-07-09 10:39:38 -07:00
..
__tests__ Move files in Phabricator one level up 2012-06-01 12:32:44 -07:00
celerity Avoid resolving path in celerity resource map 2012-06-08 17:20:52 -07:00
daemon Add --verbose support to phd 2012-06-19 12:56:41 -07:00
diff Fix displaying of inlines related both to visible and hidden diff 2012-06-18 18:11:24 -07:00
edges Allow edges to be configured to prevent cycles 2012-07-09 10:39:38 -07:00
events Add an example event listener, improve documentation, and add a commit discovery event 2012-07-03 16:46:27 -07:00
internationalization Add useful text descriptions to edge transactions 2012-07-02 15:42:16 -07:00
javelin Move files in Phabricator one level up 2012-06-01 12:32:44 -07:00
lint Add a basic notification UI element 2012-06-13 15:00:24 -07:00
markup Add table markup to Phabricator 2012-07-02 14:44:38 -07:00
query Consolidate feed query code 2012-07-02 15:41:19 -07:00
storage Store forced connections in the Lisk connection cache 2012-07-09 10:39:21 -07:00
testing Move files in Phabricator one level up 2012-06-01 12:32:44 -07:00
util Namespace GlobalLocks to storage namespaces 2012-07-09 10:39:30 -07:00
PhabricatorAccessLog.php Move files in Phabricator one level up 2012-06-01 12:32:44 -07:00
PhabricatorEnv.php Allow specifying custom syntax highlighter 2012-06-26 19:37:45 -07:00
PhabricatorScopedEnv.php Move files in Phabricator one level up 2012-06-01 12:32:44 -07:00
PhabricatorSetup.php Use official PHP mirror 2012-06-21 10:48:37 -07:00