Skip to content

remote: Separate handshake and resync timeouts during remote reconnection - #65457

Merged
SomeoneToIgnore merged 3 commits into
zed-industries:mainfrom
Huliiiiii:remote-reconnect-handshake
Oct 14, 2026
Merged

SomeoneToIgnore merged 3 commits into
zed-industries:mainfrom
Huliiiiii:remote-reconnect-handshake

Conversation

@Huliiiiii

@Huliiiiii Huliiiiii commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remote reconnection previously reusing the heartbeat timeout (5 secs), and started the resync timeout before the new connection completed its handshake. As a result, the timeout could expire before the handshake finished.

Refactored the code to introduce separate timeouts for the handshake and resync, with the resync timeout starting after the handshake completes.

Also moved the tests previously located in the middle of the file to the end.

Testing

A new integration test.

Self-review

  • I've reviewed my diff for quality, security, reliability, and performance.
  • UI changes follow the checklist.
  • Tests cover the new or changed behavior.

Release Notes:

  • Improved timeout handling for SSH reconnections

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Oct 10, 2026
@Huliiiiii Huliiiiii changed the title Separate handshake and resync timeouts during remote reconnection remote: Separate handshake and resync timeouts during remote reconnection Oct 10, 2026
@MrSubidubi MrSubidubi added the platform:remote Remote development, SSH and zed-remote-server label Oct 10, 2026
@SomeoneToIgnore SomeoneToIgnore self-assigned this Oct 10, 2026

@SomeoneToIgnore SomeoneToIgnore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reword the release notes to be user-facing, while we're at it.

Comment thread crates/remote/src/remote_client.rs Resolved
Comment thread crates/remote/src/remote_client.rs Resolved
}
}

pub(crate) fn reconnect(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing a prebuilt task makes the caller responsible for building it from Arc::downgrade(self).
It also only works because cx.spawn runs the task after the new outgoing_tx is assigned.
Keeping reconnect(incoming_rx, outgoing_tx, cx) and returning the ready receiver would keep that rule inside the function.

Comment thread crates/remote/src/remote_client.rs Resolved

@SomeoneToIgnore SomeoneToIgnore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Given the time left, let's merge this after the next release, just in case.

@SomeoneToIgnore
SomeoneToIgnore added this pull request to the merge queue Oct 14, 2026
Merged via the queue into zed-industries:main with commit b25dc09 Oct 14, 2026
39 checks passed
@Huliiiiii
Huliiiiii deleted the remote-reconnect-handshake branch October 15, 2026 03:29
amirkhakshour pushed a commit to SourceShift/zed-mini-ork that referenced this pull request Oct 18, 2026
…tion (zed-industries#65457)

## Summary

Remote reconnection previously reusing the heartbeat timeout (5 secs),
and started the resync timeout before the new connection completed its
handshake. As a result, the timeout could expire before the handshake
finished.

Refactored the code to introduce separate timeouts for the handshake and
resync, with the resync timeout starting after the handshake completes.

Also moved the tests previously located in the middle of the file to the
end.

## Testing

A new integration test.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Improved timeout handling for SSH reconnections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement platform:remote Remote development, SSH and zed-remote-server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants