Make it safe to call ExecFuture->resolveKill() after process resolution
Summary:
Fixes T4165. Currently, doing something like this is fine:
$exec_future->resolve(); $exec_future->resolve();
...but this isn't:
$exec_future->resolve(); $exec_future->resolveKill();
...and will raise garbage in the resolveKill() call. This is unhelpful, unexpected, and undesirable. Calling resolve*() multiple times is explicitly allowed, since it makes many patterns much easier to write and isn't sketchy or surprising or anything.
Check for an existing result before performing the kill.
Test Plan: Added a failing unit test and made it pass.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T4165
Differential Revision: https://secure.phabricator.com/D7688