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
F13090048: D19493.diff
Thu, Apr 25, 2:11 AM
Unknown Object (File)
Fri, Apr 19, 2:54 AM
Unknown Object (File)
Fri, Apr 19, 2:54 AM
Unknown Object (File)
Thu, Apr 11, 9:38 AM
Unknown Object (File)
Thu, Apr 11, 4:08 AM
Unknown Object (File)
Sat, Mar 30, 9:29 AM
Unknown Object (File)
Mar 17 2024, 12:20 PM
Unknown Object (File)
Mar 17 2024, 12:12 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