HomePhabricator

Separate individual daemon process logic into PhutilDaemonHandle

Description

Separate individual daemon process logic into PhutilDaemonHandle

Summary:
Ref T7352. Overall, I want to run one overseer per daemon group instead of one overseer per daemon, to reduce the minimum footprint of an inactive Phacility instance.

PhutilDaemonOverseer currently has a mixture of logic specific to the overseer (e.g., argument parsing, signal handling) and logic specific to the daemon process (e.g., heartbeat handling).

Separate this logic, so the Overseer has a list of DaemonHandles. Currently, it always has exactly one DaemonHandle, but the logic anticipates a future diff where it may have more than one.

Test Plan:

  • Ran bin/phd debug nice, bin/phd debug taskmaster, observed normal operation.
  • Used ^C and other signals to terminate daemons.
  • Viewed daemon status in daemon console.
  • Used phd start, phd stop to start and stop daemons normally.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7352

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