Page MenuHomePhabricator

Add a --limit argument to the `workers` management cli.
Needs RevisionPublic

Authored by 20after4 on Jun 12 2018, 11:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 2, 11:49 AM
Unknown Object (File)
Wed, Nov 27, 7:26 AM
Unknown Object (File)
Wed, Nov 20, 4:24 AM
Unknown Object (File)
Sat, Nov 16, 3:20 AM
Unknown Object (File)
Tue, Nov 12, 3:58 AM
Unknown Object (File)
Fri, Nov 8, 7:09 AM
Unknown Object (File)
Oct 16 2024, 9:32 AM
Unknown Object (File)
Sep 4 2024, 9:48 PM
Subscribers

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Summary

I needed to cancel 5 million queued worker tasks and the act of
canceling them via the cli was using 30gigs of memory without making
any progress. Adding a limit argument makes the cli usable for
deleting queued workers in batches of a reasonable size
(e.g. 100,000 at a time)

Test Plan

tested on wikimedia's fork in production. Without --limit I saw
a huge memory usage without making any progress. With --limit 100000
progress was possible.

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 20422
Build 27734: Run Core Tests
Build 27733: arc lint + arc unit

Event Timeline

I think we should rewrite this to use the recent PhabricatorQueryIterator iterator (so it "just works") instead of having an explicit limit. That will be a slightly more involved change since we can't do some of these tests directly anymore. We also want to really return two iterators (active + archived) that act like one iterator, which we can do with MultipleIterator (but, PHP 5.3.0+) or by writing a copy of that which works with PHP 5.2.3, but that's even more involved. It might effectively be necessary anyway to get the setServerTime() call working transparently.

This is kind of a lot of weird stuff, so maybe just throw this in Maniphest with a pointer here and I'll figure out how to get PhabricatorIteratingMultipleIteratorIteratorForIterators or whatever actually fits the bill hooked up?

This revision now requires changes to proceed.Jun 21 2018, 11:04 PM