Repository navigation
Native russh SFTP backend + single-copy reads + unified child construction - #19
Merged
Merged
Conversation
hoshimura
force-pushed
the
pr2-native-ssh-and-perf
branch
from
October 2, 2026 08:01
119bd55 to
a17ae02
Compare
- rust/src/ssh.rs: russh + russh-sftp + russh::keys SFTP, pooled sessions, host-key verification via check_known_hosts (strict by default) - ops: read/read_range/write/exists/stat/list/mkdir/rmdir/unlink/rename - flat connection kwargs spread via _native_kwargs (house **kwargs convention) - opt-in ASANYPATH_SSH_NATIVE=1; asyncssh stays default (ssh_config, walk, lstat) - stat/list return full attrs (size,mtime,atime,uid,gid,permissions)
asyncssh disables host-key checking for None; mirror it (and SSH_KNOWN_HOSTS=none -> ()) so the native backend connects to the same hosts as the default transport.
Return reqwest Bytes straight into Python `bytes` via a PyBytesBuf bridge instead of body.to_vec() + PyO3 Vec<u8>->bytes. Eliminates one full-payload memcpy per read across S3/GCS/Azure/Artifactory (get + range_get) and HTTP. Measured 64MiB read: 69.3 -> 57.0 ms (0.97 -> 1.18 GB/s).
Single fast path for every backend: _child(uri, **attrs) spawns from a canonical URI (no per-child __init__: scheme re-parse, env read, ssh_config resolution) and attaches listing-known attrs (SSH _cached_attrs, Artifactory _is_folder, HTTP _trailing_slash). Replaces the parallel per-backend `type(self)(...)` / `self / name` child builds in S3/GCS/Azure/Artifactory/ HTTP/SSH/FTP iterdir. SSH child construction with ssh_config alias resolution: 52.3 -> 3.6 us (14.6x).
- native ssh_lstat + ssh_setstat (chmod/chown/utime) - native ssh_config resolution via ssh2-config (drop asyncssh parser) - native keyboard-interactive auth + ssh_disconnect_all
…able The _HAS_ASYNCSSH conditionals made protocols/auth-show SSH assertions and scp-style alias tests depend on asyncssh being installed, so they failed on a clean (no-asyncssh) install. SSH is now native, so assert unconditionally.
hoshimura
force-pushed
the
pr2-native-ssh-and-perf
branch
from
October 2, 2026 11:08
5bcc9ea to
4d375c8
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the asyncssh Python transport with an off-GIL native russh backend and lands the remaining read/listing perf work (these are interleaved through ssh.py/_child, so they ship together):
Checklist