Page MenuHomePhabricator

Move "update related object after commit" to a separate worker in the task queue
ClosedPublic

Authored by epriestley on Apr 22 2019, 10:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 9:21 AM
Unknown Object (File)
Thu, Mar 28, 6:19 PM
Unknown Object (File)
Thu, Mar 28, 1:47 PM
Unknown Object (File)
Thu, Mar 28, 12:43 PM
Unknown Object (File)
Mar 21 2024, 3:59 AM
Unknown Object (File)
Mar 19 2024, 3:19 PM
Unknown Object (File)
Feb 15 2024, 3:07 AM
Unknown Object (File)
Feb 7 2024, 9:17 PM
Subscribers
None

Details

Summary

Depends on D20462. Ref T13276. Currently, the "Message" parser also updates related tasks and revisions when a commit is published.

For PHI1165, which ran into a race with message parsing, I originally believed we needed to separate this logic and lock + yield to avoid the race. D20462 provides what is probably a better approach for avoiding the race.

Still, I think separating these "update related revisions" and "updated related tasks" chunks into separate workers is a net improvement. There may still be some value in doing lock + yield in the future to deal with other issues, and when we occasionally run into problems with pulling a diff out of the repository to update the revision (usually because the diff is too big) this isolates the problem better and allows the commit to import.

I think the only thing to watch out for here is that Herald may now run before the revision and commit are attached to one another. This is fine for all current Herald rules, we just need to be mindful in implementing new rules.

Test Plan

Used bin/repository reparse --message on various commits, including commits that close revisions and close tasks.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php
314–330

This works with workers which queue other workers. The old code was just a very old version of the more modern "run in process" flag.

amckinley added inline comments.
src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php
143

Whoa, that's a new one.

This revision is now accepted and ready to land.Apr 24 2019, 12:32 AM
src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php
143

Haha, yeah -- I think there's a comment somewhere else in the internals, but basically we don't want Fixes T123 to also generate an "alice mentioned Txxx on..." transaction since it's redundant.

This revision was automatically updated to reflect the committed changes.