This does two things. Important one: it reverts #19193, which lead to our whole process handling breaking. When the `proxy` process was killed, it apparently didn't close the stdout/stderr anymore, which meant we would not detect when it died. (Watching its `status()` in the io loop also didn't work!) We should figure out how to keep our process handling working before we make this change in #19193, which sounds reasonable. Second, less important thing: I think we should treat the process being killed from a signal as non-zero, as an error. Release Notes: - N/A
This commit is contained in:
parent
8924b3fb5b
commit
e3c6ba4bd7
1 changed files with 5 additions and 9 deletions
|
@ -846,7 +846,10 @@ impl SshRemoteClient {
|
||||||
child_stdin.close().await?;
|
child_stdin.close().await?;
|
||||||
outgoing_rx.close();
|
outgoing_rx.close();
|
||||||
let status = ssh_proxy_process.status().await?;
|
let status = ssh_proxy_process.status().await?;
|
||||||
return Ok(status.code());
|
// If we don't have a code, we assume process
|
||||||
|
// has been killed and treat it as non-zero exit
|
||||||
|
// code
|
||||||
|
return Ok(status.code().or_else(|| Some(1)));
|
||||||
}
|
}
|
||||||
Ok(len) => {
|
Ok(len) => {
|
||||||
if len < stdout_buffer.len() {
|
if len < stdout_buffer.len() {
|
||||||
|
@ -1175,14 +1178,7 @@ impl SshRemoteConnection {
|
||||||
.stderr(Stdio::piped())
|
.stderr(Stdio::piped())
|
||||||
.env("SSH_ASKPASS_REQUIRE", "force")
|
.env("SSH_ASKPASS_REQUIRE", "force")
|
||||||
.env("SSH_ASKPASS", &askpass_script_path)
|
.env("SSH_ASKPASS", &askpass_script_path)
|
||||||
.args([
|
.args(["-N", "-o", "ControlMaster=yes", "-o"])
|
||||||
"-N",
|
|
||||||
"-o",
|
|
||||||
"ControlPersist=no",
|
|
||||||
"-o",
|
|
||||||
"ControlMaster=yes",
|
|
||||||
"-o",
|
|
||||||
])
|
|
||||||
.arg(format!("ControlPath={}", socket_path.display()))
|
.arg(format!("ControlPath={}", socket_path.display()))
|
||||||
.arg(&url)
|
.arg(&url)
|
||||||
.spawn()?;
|
.spawn()?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue