Page MenuHomePhabricator

Allow tasks to yield to other tasks
ClosedPublic

Authored by epriestley on Apr 16 2014, 6:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 6:36 PM
Unknown Object (File)
Wed, Dec 11, 8:45 AM
Unknown Object (File)
Tue, Dec 10, 3:29 AM
Unknown Object (File)
Wed, Dec 4, 8:40 PM
Unknown Object (File)
Wed, Dec 4, 8:40 PM
Unknown Object (File)
Tue, Nov 26, 11:52 AM
Unknown Object (File)
Oct 22 2024, 5:19 PM
Unknown Object (File)
Oct 18 2024, 7:57 AM
Subscribers

Details

Reviewers
btrahan
Maniphest Tasks
T1049: Implement Harbormaster
Commits
Restricted Diffusion Commit
rP4a6d2e9c9730: Allow tasks to yield to other tasks
Summary

For Harbormaster tasks which want to poll or wait, this lets them say "try again a little later" without having to sleep and hold a queue slot.

This is basically the same as failing, except that we don't increment the failure counter. Instead, we just set the current lease to the correct length and then exit. The task will be retried after the lease expires.

Test Plan

Using both bin/harbormaster and phd debug taskmaster, ran a lot of waiting tasks through the queue, faking them to either yield or not yield in a controlled manner. The queue responded as expected, yielding tasks appropraitely and retrying them later.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Allow tasks to yield to other tasks.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
src/applications/harbormaster/query/HarbormasterBuildQuery.php
135–163

Offhand, this is the best general-purpose systematic fix I can come up with for the withSomePHIDs($phids) issue, where $phids is sometimes empty and we accidentally load everything, since it will make the %Ls conversion throw (it does not accept empty array).

btrahan edited edge metadata.
This revision is now accepted and ready to land.Apr 16 2014, 6:37 PM
epriestley updated this revision to Diff 20865.

Closed by commit rP4a6d2e9c9730 (authored by @epriestley).