From b555e4bd9189d0904ae69250a60ed8803b1f4d13 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 15 Dec 2013 12:52:31 -0800 Subject: [PATCH] Use more sensible waitForAny semantics in SSH process Summary: Ref T4189. Updates the Phabricator stuff to use the new, more sensible semantics from D7769. Basically, this works correctly now and doesn't need workarounds. Test Plan: Pushed Wine repo in 1m13s. Reviewers: btrahan, zeeg Reviewed By: btrahan CC: aran Maniphest Tasks: T4189 Differential Revision: https://secure.phabricator.com/D7770 --- .../ssh/PhabricatorSSHPassthruCommand.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php b/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php index 9c6471d4f7..5d06490b64 100644 --- a/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php +++ b/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php @@ -76,13 +76,6 @@ final class PhabricatorSSHPassthruCommand extends Phobject { public function writeErrorIOCallback(PhutilChannel $channel, $data) { $this->errorChannel->write($data); - - // TODO: Because of the way `waitForAny()` works, we degrade to a busy - // wait if we hand it a writable, write-only channel. We should handle this - // case better in `waitForAny()`. For now, just flush the error channel - // explicity after writing data over it. - - $this->errorChannel->flush(); } public function execute() { @@ -105,9 +98,7 @@ final class PhabricatorSSHPassthruCommand extends Phobject { $channels = array($command_channel, $io_channel, $error_channel); while (true) { - // TODO: See note in writeErrorIOCallback! - $wait = array($command_channel, $io_channel); - PhutilChannel::waitForAny($wait); + PhutilChannel::waitForAny($channels); $io_channel->update(); $command_channel->update();