After the relayed process exited, beRelay closed the Process, which closed
the pseudoconsole's output pipe while the goroutine copying that output to
the relay's stdout might still be reading it, and then exited. Any output
still in the pseudoconsole at that point was lost. For a short command
that was all of it: "ssh -t host echo hello" against a domain controller
test node printed nothing in 10 of 10 tries.
Release the process instead, which closes the pseudoconsole and so lets
the output pipe reach EOF, wait for the copy to finish, and only then close
the pipes and exit.
Updates #4697
Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: I1a3c5e7f9b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a