HomePhabricator

Support SIGHUP to reload daemon processes in place

Description

Support SIGHUP to reload daemon processes in place

Summary:
Ref T7384. This is a bit out there but not wholly unreasonable and the patch is fairly small. There's at least some sort of vague argument that we'll have a use case for it in the cluster eventually.

Basically, the issue is that if you have very-long-running tasks, it's hard to restart the daemons without disrupting them. We can make this better with a signal that says "stop all the daemons gracefully, but then immediately restart them when they exit". This method will won't always work (it may not be safe across daemon or overseer change boundaries, since it leaves the overseer running older code), but will almost always work, and doesn't require some kind of mess on top of the overseer to track which overseers you've told to exit.

Test Plan: Used phd reload (next diff) to reload an overseer a bunch of times. Saw the overseer PID stay the same but all the daemon PIDs cycle. Used phd stop to stop daemons normally.

Reviewers: hach-que, btrahan

Reviewed By: btrahan

Subscribers: joshuaspence, epriestley

Maniphest Tasks: T7384

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