HomePhabricator

Emit exit event from daemon handle when daemon is not running

Description

Emit exit event from daemon handle when daemon is not running

Summary:
Ref T7352. Currently, if you ^C a daemon while the subprocess is not running (e.g., wiating to restart after a failure) we just exit without actually emitting the EXIT event.

This can leave the daemon log hanging around in the database until it eventually expires.

Instead, make sure this event always gets emitted when a daemon responds to ^C.

Test Plan: With failing tasks in queue so that the taskmasters exit immediately, ran phd start and then phd stop a few times. Preivously, this would leave phantom daemons; now it cleans them up.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7352

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

Details