mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 18:25:57 +00:00
ssh remote: Reset missed heartbeats on connection activity (#19368)
Ran into this this morning. At least I suspect I ran into it. In any case: we need to reset the missed hearbeats to 0 in case we got any connection activity. Release Notes: - N/A
This commit is contained in:
parent
4df882c295
commit
c186e99a3d
1 changed files with 9 additions and 0 deletions
|
@ -832,7 +832,15 @@ impl SshRemoteClient {
|
||||||
log::warn!("ssh heartbeat: connection activity channel has been dropped. stopping.");
|
log::warn!("ssh heartbeat: connection activity channel has been dropped. stopping.");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
keepalive_timer.set(cx.background_executor().timer(HEARTBEAT_INTERVAL).fuse());
|
keepalive_timer.set(cx.background_executor().timer(HEARTBEAT_INTERVAL).fuse());
|
||||||
|
|
||||||
|
if missed_heartbeats != 0 {
|
||||||
|
missed_heartbeats = 0;
|
||||||
|
this.update(&mut cx, |this, mut cx| {
|
||||||
|
this.handle_heartbeat_result(missed_heartbeats, &mut cx)
|
||||||
|
})?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ = keepalive_timer => {
|
_ = keepalive_timer => {
|
||||||
log::debug!("Sending heartbeat to server...");
|
log::debug!("Sending heartbeat to server...");
|
||||||
|
@ -845,6 +853,7 @@ impl SshRemoteClient {
|
||||||
ping_result
|
ping_result
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if result.is_err() {
|
if result.is_err() {
|
||||||
missed_heartbeats += 1;
|
missed_heartbeats += 1;
|
||||||
log::warn!(
|
log::warn!(
|
||||||
|
|
Loading…
Reference in a new issue