Homec4science

Reorganize PhutilDaemon into Overseers, Pools and Daemons in libphutil

Authored by epriestley <git@epriestley.com> on Feb 20 2017, 21:04.

Description

Reorganize PhutilDaemon into Overseers, Pools and Daemons in libphutil

Summary:
Ref T12298. Ultimate goal is to let daemon pools scale down to 0 daemons when they aren't doing anything. This doesn't do that yet (and attempts to change no behavior).

This reorganizes the daemon code to make this change easier. Currently, some daemons are in pools and some are not. Intead, make everything a pool (the Pull and Trigger daemons just get pools with maximum size 1).

New object hiearchy is:

  • Overseer
    • Pool
      • Daemon

...and those objects each pretty much take care of their own stuff, instead of having daemons reach up into the Overseer to dispatch events back to themselves.

Test Plan:

  • Ran phd debug, phd start, phd stop, phd status, etc.
  • Reviewed daemons in web console.
  • Changed config, saw daemons automatically restart.
  • Sent daemons signals.
  • Used --trace, activated memory tracing, activated verbose mode.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12298

Differential Revision: https://secure.phabricator.com/D17389

Details

Committed
epriestley <git@epriestley.com>Feb 22 2017, 22:15
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUef580c9ccc21: In Phage, don't sit in a loop once we've read all messages from an agent
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUbe546154255c: Reorganize PhutilDaemon into Overseers, Pools and Daemons in libphutil (authored by epriestley <git@epriestley.com>).Feb 22 2017, 22:15