Skip to content

feat(rsync_io): async SshTransport::execute_remote_rsync behind --features async-ssh (#1796) - #4273

Merged
oferchen merged 1 commit into
masterfrom
feat/ssh-execute-remote-rsync-async-1796
May 17, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/ssh-execute-remote-rsync-async-1796

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Introduces AsyncSshTransport::execute_remote_rsync as the tokio-backed counterpart to SshConnection::connect_with_config (added by PR feat(rsync_io): SshConnection connect_with_config (timeout + keepalive) (#1795) #4266). The async path reuses the existing SshCommand builder so argv composition stays byte-identical between sync and async transports for any given (remote, args, config) triple.
  • New --features async-ssh cargo feature gates the entire async module. Default builds remain on the synchronous std::process transport with no tokio dependency in the SSH path.
  • AsyncSshTransport::split returns (impl AsyncRead, impl AsyncWrite) halves backed by tokio::process::ChildStdout / ChildStdin. wait() reaps the child cleanly; the underlying Child is constructed with kill_on_drop(true) so accidental early drop never leaks zombies.
  • The ChannelReader / ChannelWriter adapters that wire these halves into the multiplex framing layer are deferred to task Document apple filesystem helpers #1797.

Files

  • crates/rsync_io/Cargo.toml - declare async-ssh = [\"dep:tokio\"] feature.
  • crates/rsync_io/src/ssh/async_transport.rs - new module (gated #[cfg(feature = \"async-ssh\")]).
  • crates/rsync_io/src/ssh/mod.rs - wire the new module and re-export AsyncSshTransport.
  • crates/rsync_io/src/ssh/builder.rs - promote command_parts to pub(super) so the async module can compose the same argv as SshCommand::spawn.
  • crates/rsync_io/src/ssh/connect.rs - refresh the doc references to point at the now-existing async entry point.

Test plan

  • cargo fmt --all clean.
  • CI fmt + clippy on default features.
  • CI nextest (default features) - exercises sync transport only; async path is feature-gated.
  • Manual: cargo nextest run -p rsync_io --features async-ssh -E 'test(async_transport)' on Linux/macOS.
  • Manual smoke under OC_RSYNC_SSH_NET=1 against an unroutable host confirms the watchdog-equivalent ConnectTimeout path returns a non-zero exit status within a bounded window.

Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
@oferchen
oferchen force-pushed the feat/ssh-execute-remote-rsync-async-1796 branch from 6790ee5 to 7886b4c Compare May 17, 2026 20:47
@oferchen
oferchen merged commit e95255f into master May 17, 2026
1 check passed
oferchen added a commit that referenced this pull request May 17, 2026
…1805) (#4290)

Adds an async-ssh feature on the core crate that pulls in the tokio-backed
`rsync_io::ssh::AsyncSshTransport` (PR #4273) and bridges it into the
existing synchronous client transfer orchestration. A new
`async_ssh_transport` module spawns the async transport, copies bytes
between its `AsyncRead`/`AsyncWrite` halves and the sync handshake +
server-framing layer via the `ChannelReader`/`ChannelWriter` adapters,
and runs the sync server flow under `tokio::task::spawn_blocking`.

The client driver picks the async path when the `OC_RSYNC_ASYNC_SSH=1`
env var is set; the CLI flag is deferred to #1806. Progress observation
and remote-to-remote proxy transfers remain on the sync path for now.
@github-actions github-actions Bot added the enhancement New feature or request label May 17, 2026
oferchen added a commit that referenced this pull request May 18, 2026
… (#4273)

Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
oferchen added a commit that referenced this pull request May 18, 2026
…1805) (#4290)

Adds an async-ssh feature on the core crate that pulls in the tokio-backed
`rsync_io::ssh::AsyncSshTransport` (PR #4273) and bridges it into the
existing synchronous client transfer orchestration. A new
`async_ssh_transport` module spawns the async transport, copies bytes
between its `AsyncRead`/`AsyncWrite` halves and the sync handshake +
server-framing layer via the `ChannelReader`/`ChannelWriter` adapters,
and runs the sync server flow under `tokio::task::spawn_blocking`.

The client driver picks the async path when the `OC_RSYNC_ASYNC_SSH=1`
env var is set; the CLI flag is deferred to #1806. Progress observation
and remote-to-remote proxy transfers remain on the sync path for now.
oferchen added a commit that referenced this pull request May 18, 2026
… (#4273)

Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
oferchen added a commit that referenced this pull request May 18, 2026
…1805) (#4290)

Adds an async-ssh feature on the core crate that pulls in the tokio-backed
`rsync_io::ssh::AsyncSshTransport` (PR #4273) and bridges it into the
existing synchronous client transfer orchestration. A new
`async_ssh_transport` module spawns the async transport, copies bytes
between its `AsyncRead`/`AsyncWrite` halves and the sync handshake +
server-framing layer via the `ChannelReader`/`ChannelWriter` adapters,
and runs the sync server flow under `tokio::task::spawn_blocking`.

The client driver picks the async path when the `OC_RSYNC_ASYNC_SSH=1`
env var is set; the CLI flag is deferred to #1806. Progress observation
and remote-to-remote proxy transfers remain on the sync path for now.
@oferchen
oferchen deleted the feat/ssh-execute-remote-rsync-async-1796 branch May 19, 2026 19:28
oferchen added a commit that referenced this pull request Aug 24, 2026
… (#4273)

Introduce `AsyncSshTransport::execute_remote_rsync` as the tokio-backed
counterpart to `SshConnection::connect_with_config`. Argv composition is
delegated through the existing `SshCommand` builder so the sync and
async paths render byte-identical SSH command lines for any given
(remote, args, config) triple.

The new module is gated behind `--features async-ssh`, opt-in only.
Default builds remain on the synchronous `std::process` transport with
no tokio dependency. The downstream `ChannelReader`/`ChannelWriter`
adapters that bridge these halves into the multiplex framing layer are
tracked separately as task #1797.
oferchen added a commit that referenced this pull request Aug 24, 2026
…1805) (#4290)

Adds an async-ssh feature on the core crate that pulls in the tokio-backed
`rsync_io::ssh::AsyncSshTransport` (PR #4273) and bridges it into the
existing synchronous client transfer orchestration. A new
`async_ssh_transport` module spawns the async transport, copies bytes
between its `AsyncRead`/`AsyncWrite` halves and the sync handshake +
server-framing layer via the `ChannelReader`/`ChannelWriter` adapters,
and runs the sync server flow under `tokio::task::spawn_blocking`.

The client driver picks the async path when the `OC_RSYNC_ASYNC_SSH=1`
env var is set; the CLI flag is deferred to #1806. Progress observation
and remote-to-remote proxy transfers remain on the sync path for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant