ssh remoting: Fix hang when activity channel gets dropped (#19275)
When the SSH command dies or the server, the channel gets dropped and the heartbeat method went into an infinite loop causing a hang. Oversight from yesterday. Fixed now. Release Notes: - N/A
This commit is contained in:
parent
84018d7a2d
commit
eb76065ad3
1 changed files with 5 additions and 1 deletions
|
@ -743,7 +743,11 @@ impl SshRemoteClient {
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
select_biased! {
|
select_biased! {
|
||||||
_ = connection_activity_rx.next().fuse() => {
|
result = connection_activity_rx.next().fuse() => {
|
||||||
|
if result.is_none() {
|
||||||
|
log::warn!("ssh heartbeat: connection activity channel has been dropped. stopping.");
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
keepalive_timer.set(cx.background_executor().timer(HEARTBEAT_INTERVAL).fuse());
|
keepalive_timer.set(cx.background_executor().timer(HEARTBEAT_INTERVAL).fuse());
|
||||||
}
|
}
|
||||||
_ = keepalive_timer => {
|
_ = keepalive_timer => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue