perf(sftp): adopt the russh-sftp borrowed write API in upload dispatch
Les mainteneurs répondent en général sous 1 jour
@inureyes y travaille déjà.
Depuis le 5/11/2026.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- rust
- Domaine
- cli, performance
Piste de recherche
Start with src/ssh/tokio_client/sftp_client.rs and read write_all_pipelined, then check whether a russh-sftp release exposes write_nowait_from_slice and Request; the issue says not to start before that release is available. Adapt the upload reader and bounded acknowledgement window while preserving #321's throttling, and run the existing upload tests. Done means file and stdin uploads work and the #322 benchmark reaches within about 5% of upstream io::copy_buf throughput.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem / Background
Issue #322 profiled the SFTP upload pipeline against upstream russh-sftp's own copy path (local sftp-server, RTT 0). bssh's SftpClient::upload_from reaches 78-85% of upstream throughput, and roughly 10% of the gap comes from a double copy per chunk: write_all_pipelined (src/ssh/tokio_client/sftp_client.rs) reads into a freshly allocated owned Vec, then the write call serializes that buffer a second time into the outgoing frame.
The fix needs a borrowed, non-awaiting write API that russh-sftp currently keeps private (RawSftpSession::write_nowait_from_slice and the Request handle are pub(crate)). Upstream PR AspectUnk/russh-sftp#105 ("feat(client): expose the borrowed, non-awaiting write") makes both public and re-exports Request from russh_sftp::client. This issue is blocked on that PR being merged and released; as of 2026-10-20 its workflow runs were still awaiting maintainer approval, so expect the wait to take a while. Do not start before a russh-sftp release containing it is available.
Proposed Solution
- Bump the russh-sftp dependency to a release containing AspectUnk/russh-sftp#105.
- Rework write_all_pipelined to take an AsyncBufRead reader, dispatch each fill_buf slice with write_nowait_from_slice (no per-chunk Vec allocation, one copy per chunk), and keep a bounded window (VecDeque) of the returned Request handles, awaiting the oldest ack when the window fills so the backpressure behavior added in #321 is preserved.
- Adapt non-buffered sources (tokio's File does not implement AsyncBufRead) so file and stdin uploads keep working, for example with a BufReader wrapper.
- Out of scope: the residual multi-threaded scheduling margin measured in #322 (worker handoff cost). This issue only targets the double-copy gap.
Acceptance Criteria
- The upload path dispatches directly from the reader's borrowed buffer: no per-chunk owned allocation, one copy per chunk.
- The russh-sftp dependency is updated to a release that publicly exposes write_nowait_from_slice and Request.
- The in-flight window stays bounded with oldest-first ack collection, and #321's throttle behavior is preserved.
- File and stdin uploads still work (AsyncBufRead adaptation for non-buffered readers), and existing upload tests pass.
- The #322 benchmark scenario (local sftp-server, RTT 0, single-threaded runtime) shows the double-copy gap recovered: throughput within about 5% of the upstream io::copy_buf path.
- Langage dominant
- Rust
- Étoiles
- 71
- Forks
- 7
- Merge moyen
- 4 h 51 min
- PR mergées (30 j)
- 14
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de lablup/bssh
-
feat(ssh): add webauthn-sk host-key supportPeut-être pris @inureyes l’a pris il y a 24 jours. Ouvertepriority:low status:blocked type:enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
lablup/bssh#345 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
fix(security): enforce sk-* UP and UV flags once russh exposes the signaturePeut-être pris @inureyes l’a pris il y a 24 jours. Ouvertepriority:medium status:blocked type:security
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
lablup/bssh#340 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
fix(security): verify the server host key presented on re-keyPeut-être pris @inureyes l’a pris il y a 24 jours. Ouvertepriority:low status:blocked type:security
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
lablup/bssh#336 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
feat(agent): bind destination-constrained agent keys with [email protected]Peut-être pris @inureyes l’a pris il y a 24 jours. Ouvertepriority:medium status:blocked type:enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
lablup/bssh#327 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
feat: Implement real-time streaming output with interactive multi-node UIPeut-être pris @inureyes l’a pris il y a 396 jours. Ouvertepriority:medium status:backlog type:enhancement
lablup/bssh#68 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de lablup/bssh
Issues similaires
-
area:ui effort:medium enhancement P7 source:agent
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
marketing
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Read a requested CodeRabbit PR review's findings with `coderabbit pullrequest --show-threads`Ouvertedocumentation priority: low tech-debt
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
nledford/Ladderback#1823 ·
Les mainteneurs répondent en général sous 1 jour
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)Peut-être pris @ealwanlee l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
psmux/psmux-plugins#47 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
Les mainteneurs répondent en général sous 1 jour