Skip to content

Commit

Permalink
ssh remote: Reset missed heartbeats on connection activity (#19368)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mrnugget authored Oct 17, 2024
1 parent 4df882c commit c186e99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/remote/src/ssh_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,15 @@ impl SshRemoteClient {
log::warn!("ssh heartbeat: connection activity channel has been dropped. stopping.");
return Ok(());
}

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 => {
log::debug!("Sending heartbeat to server...");
Expand All @@ -845,6 +853,7 @@ impl SshRemoteClient {
ping_result
}
};

if result.is_err() {
missed_heartbeats += 1;
log::warn!(
Expand Down

0 comments on commit c186e99

Please sign in to comment.