Page MenuHomePhabricator

Allow tasks to yield to other tasks
ClosedPublic

Authored by epriestley on Apr 16 2014, 6:07 PM.
Tags
None
Referenced Files
F14390234: D8792.id20865.diff
Sat, Dec 21, 6:15 PM
F14390233: D8792.id20855.diff
Sat, Dec 21, 6:15 PM
F14390231: D8792.id.diff
Sat, Dec 21, 6:15 PM
F14390230: D8792.diff
Sat, Dec 21, 6:15 PM
Unknown Object (File)
Thu, Dec 19, 1:43 PM
Unknown Object (File)
Thu, Dec 19, 11:09 AM
Unknown Object (File)
Mon, Dec 16, 6:36 PM
Unknown Object (File)
Wed, Dec 11, 8:45 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
Branch
wait4
Lint
Lint Passed
Unit
Tests Passed

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).