Page MenuHomePhabricator

Allow tasks to yield to other tasks
ClosedPublic

Authored by epriestley on Apr 16 2014, 6:07 PM.
Tags
None
Referenced Files
F14834123: D8792.diff
Thu, Jan 30, 2:01 PM
Unknown Object (File)
Sun, Jan 26, 4:55 AM
Unknown Object (File)
Tue, Jan 21, 9:11 AM
Unknown Object (File)
Fri, Jan 17, 9:23 AM
Unknown Object (File)
Thu, Jan 16, 3:18 AM
Unknown Object (File)
Thu, Jan 9, 1:03 PM
Unknown Object (File)
Dec 24 2024, 8:29 AM
Unknown Object (File)
Dec 21 2024, 6:15 PM
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).