Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh remote: Reset missed heartbeats on connection activity #19368

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading