Homec4science

Make it safe to call ExecFuture->resolveKill() after process resolution

Authored by epriestley <git@epriestley.com> on Dec 3 2013, 19:32.

Description

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

Details

Committed
epriestley <git@epriestley.com>Dec 3 2013, 19:32
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU5085f26935d4: Add a signal handler for SIGUSR2.
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUdeed2a5e8e6a: Make it safe to call ExecFuture->resolveKill() after process resolution (authored by epriestley <git@epriestley.com>).Dec 3 2013, 19:32