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)
Fri, Apr 19, 3:34 AM
Unknown Object (File)
Fri, Apr 19, 3:34 AM
Unknown Object (File)
Fri, Apr 19, 3:33 AM
Unknown Object (File)
Thu, Apr 11, 8:48 AM
Unknown Object (File)
Thu, Apr 11, 8:48 AM
Unknown Object (File)
Thu, Apr 11, 8:17 AM
Unknown Object (File)
Thu, Apr 11, 8:01 AM
Unknown Object (File)
Thu, Apr 11, 4:46 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).