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)
Mon, Nov 18, 8:23 PM
Unknown Object (File)
Wed, Nov 13, 6:03 PM
Unknown Object (File)
Tue, Oct 29, 9:28 PM
Unknown Object (File)
Sun, Oct 27, 6:55 AM
Unknown Object (File)
Oct 14 2024, 8:32 PM
Unknown Object (File)
Oct 14 2024, 4:54 PM
Unknown Object (File)
Oct 9 2024, 12:13 PM
Unknown Object (File)
Oct 2 2024, 11:34 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.