1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/infrastructure
epriestley 29fd3f136b Allow columns to be marked as nonmutable (so save() will not change them)
Summary:
Ref T6840. This feels a little dirty; open to alternate suggestions.

We currently have a race condition where multiple daemons may load a commit and then save it at the same time, when processing "reverts X" text. Prior to this feature, two daemons would never load a commit at the same time.

The "reverts X" load/save has no effect (doesn't change any object properties), but it will set the state back to the loaded state on save(). This overwrites any flag updates made to the commit in the meantime, and can produce the race in T6840.

In other cases (triggers, harbormaster, repositories) we deal with this kind of problem with "append-only-updates + single-consumer", or a bunch of locking. There isn't really a good place to add a single consumer for commits, since a lot of daemons need to access them. We could move the flags column to a separate table, but this feels pretty complicated. And locking is messy, also mostly because we have so many consumers.

Just exempting this column (which has unusual behavior) from `save()` feels OK-ish? I don't know if we'll have other use cases for this, and I like it even less if we never do, but this patch is pretty small and feels fairly understandable (that said, I also don't like that it can make some properties just silently not update if you aren't on the lookout).

So, this is //a// fix, and feels simplest/least-bad for the moment to me, I thiiink.

Test Plan: Added and executed unit tests.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6840

Differential Revision: https://secure.phabricator.com/D11822
2015-02-19 10:37:17 -08:00
..
customfield Fix visiblity of LiskDAO::getConfiguration() 2015-01-14 06:54:13 +11:00
daemon Improve taskmaster behavior on empty queues 2015-02-16 11:30:49 -08:00
diff Update InlineCommentSummary UI 2015-02-09 08:38:51 -08:00
edges Modernize remaining edge types 2015-01-03 10:58:20 +11:00
env Update Phabricator to work with more modular translations 2015-02-11 13:02:35 -08:00
events Add a "did verify email" event to Phabricator 2015-02-11 14:39:06 -08:00
internationalization Projects - fix translation strings in watcher edge class 2015-02-18 15:44:54 -08:00
javelin Allow Javelin initBehavior to source alternative library behaviors 2014-11-04 06:47:07 -08:00
lint/linter Use new FutureIterator instead of Futures 2014-12-30 23:13:38 +11:00
log Explicitly declare method/property visibility 2015-01-12 08:18:13 +11:00
management Add some of a billing daemon skeleton 2015-01-30 11:29:05 -08:00
markup Fix a pht method call 2015-02-11 06:54:10 +11:00
query Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
sms Fix visibility of the PhabricatorWorker::doWork() methods 2015-01-16 06:58:50 +11:00
ssh Proxy VCS SSH requests 2015-01-28 14:41:24 -08:00
storage Allow columns to be marked as nonmutable (so save() will not change them) 2015-02-19 10:37:17 -08:00
testing Fix method visibility for PhabricatorTrivialTestCase::willRunOneTest 2015-01-14 07:04:36 +11:00
time Change double quotes to single quotes. 2014-06-09 11:36:50 -07:00
util Improve Phriction page move dialog 2014-11-12 07:04:51 -08:00
PhabricatorEditor.php Use ManiphestTaskQuery in nearly all interfaces 2013-09-25 13:44:14 -07:00