Skip to content

[WIP] test(files_external): cover shared SFTP client use during reads - #66787

Draft
joshtrichards wants to merge 4 commits into
masterfrom
jtr/SFTPReadStream-fixes
Draft

joshtrichards wants to merge 4 commits into
masterfrom
jtr/SFTPReadStream-fixes

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Nov 19, 2026 •

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

  1. Exercise an uncached stat on the same SFTP client while a read stream remains open, both immediately after opening and after an initial read. Verify that the stat succeeds and the stream returns the full response. In master this should fail, at least against OpenSSH.
  2. Fix the SFTP stream test classes so they actually are being ran (they aren't currently). Move the SFTP stream test classes, which don't use a live SFTP server, are located in tests/Storage/ but also not specified to run in the live SFTP server test runs; the entire contents of tests/Storage is also excluded from being ran by the non-live SFTP runs. A broader/cleaner bit of tidying will likely require a follow-up.

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Exercise an uncached stat on the same SFTP client while a read stream remains open, both immediately after opening and after an initial read.

Verify that the stat succeeds and the stream returns the full response.

Assisted-by: Copilot:gpt-6.1-sol

Signed-off-by: Josh <josh.t.richards@gmail.com>
Request and consume each read chunk within stream_read() instead of prefetching during open, seek, or after a read. This prevents other operations on the shared client from consuming a pending DATA response as their own, as reproduced by the SFTP integration tests against OpenSSH.

Keep the remote handle and 256 KiB buffering, but remove pending-read tracking and response draining during seek and close. Propagate send failures rather than attempting to receive after an unsuccessful send.

This removes overlap between remote fetching and caller consumption, not an additional round trip per chunk. Fast consumers should see limited impact, but... And performance has not been real-world benchmarked.

Assisted-by: Copilot:gpt-6.1-sol

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants