mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
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
This commit is contained in:
parent
0011068d7a
commit
b555e4bd91
1 changed files with 1 additions and 10 deletions
|
@ -76,13 +76,6 @@ final class PhabricatorSSHPassthruCommand extends Phobject {
|
||||||
|
|
||||||
public function writeErrorIOCallback(PhutilChannel $channel, $data) {
|
public function writeErrorIOCallback(PhutilChannel $channel, $data) {
|
||||||
$this->errorChannel->write($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() {
|
public function execute() {
|
||||||
|
@ -105,9 +98,7 @@ final class PhabricatorSSHPassthruCommand extends Phobject {
|
||||||
$channels = array($command_channel, $io_channel, $error_channel);
|
$channels = array($command_channel, $io_channel, $error_channel);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
// TODO: See note in writeErrorIOCallback!
|
PhutilChannel::waitForAny($channels);
|
||||||
$wait = array($command_channel, $io_channel);
|
|
||||||
PhutilChannel::waitForAny($wait);
|
|
||||||
|
|
||||||
$io_channel->update();
|
$io_channel->update();
|
||||||
$command_channel->update();
|
$command_channel->update();
|
||||||
|
|
Loading…
Reference in a new issue