Commit 959a835b authored by epriestley's avatar epriestley
Browse files

When executing a repository passthru command via CommandEngine, don't set a timeout

Ref T13541. The passthru future does not have time limit behavior, so if we reach this code we currently fail.

Phabricator never reaches this code normally, but this code is reachable during debugging if you try to foreground a slow fetch to inspect it.

Passthru commands generally only make sense to run interactively, and the caller or control script can enforce their own timeouts (usually by pressing "^C" with their fingers).

Test Plan: Used a debugging script to run ref-by-ref fetches in the foreground.

Maniphest Tasks: T13541

Differential Revision:
parent 4fd0628f
......@@ -120,6 +120,7 @@ abstract class DiffusionCommandEngine extends Phobject {
public function newFuture() {
$argv = $this->newCommandArgv();
$env = $this->newCommandEnvironment();
$is_passthru = $this->getPassthru();
if ($this->getSudoAsDaemon()) {
$command = call_user_func_array('csprintf', $argv);
......@@ -127,7 +128,7 @@ abstract class DiffusionCommandEngine extends Phobject {
$argv = array('%C', $command);
if ($this->getPassthru()) {
if ($is_passthru) {
$future = newv('PhutilExecPassthru', $argv);
} else {
$future = newv('ExecFuture', $argv);
......@@ -139,7 +140,9 @@ abstract class DiffusionCommandEngine extends Phobject {
// to try to avoid cases where `git fetch` hangs for some reason and we're
// left sitting with a held lock forever.
$repository = $this->getRepository();
if (!$is_passthru) {
return $future;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment