On becoming leader, it is helpful for the TaskRunner and TaskQueue to be available when the SupervisorManager starts up, to aid the supervisors in discovering their tasks.
On stopping leadership, it is helpful for the TaskRunner and TaskQueue to be available until the SupervisorManager has finished shutting down.
To achieve this, this patch splits the TaskMaster leader concept into "half leader" (queue and runner only) and "full leader" (queue, runner, and supervisor manager). The TaskMaster becomes half leader while the SupervisorManager is starting or stopping; full leader while the SupervisorManager is running.
On becoming leader, it is helpful for the TaskRunner and TaskQueue to be available when the SupervisorManager starts up, to aid the supervisors in discovering their tasks.
On stopping leadership, it is helpful for the TaskRunner and TaskQueue to be available until the SupervisorManager has finished shutting down.
To achieve this, this patch splits the TaskMaster leader concept into "half leader" (queue and runner only) and "full leader" (queue, runner, and supervisor manager). The TaskMaster becomes half leader while the SupervisorManager is starting or stopping; full leader while the SupervisorManager is running.