Skip to content

fix(integrations/unftp-sbe): avoid copy flush amplification#7217

Merged
Xuanwo merged 1 commit intomainfrom
xuanwo/unftp-sbe-copy-loop-mem
Feb 23, 2026
Merged

fix(integrations/unftp-sbe): avoid copy flush amplification#7217
Xuanwo merged 1 commit intomainfrom
xuanwo/unftp-sbe-copy-loop-mem

Conversation

@Xuanwo
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo commented Feb 23, 2026

Which issue does this PR close?

N/A (related to discussion #7200).

Rationale for this change

unftp-sbe currently uses tokio::io::copy in put. Under slow uploads with small packets, copy can hit pending-read paths that flush the writer frequently, which interacts poorly with buffered multipart writers and can amplify memory usage.

What changes are included in this PR?

  • Replace tokio::io::copy with an explicit read/write loop in integrations/unftp-sbe/src/lib.rs.
  • Keep transfer behavior simple and backpressure-driven via read + write_all.
  • Keep existing shutdown and error handling behavior unchanged.

Validation:

  • cargo check --lib (in integrations/unftp-sbe)
  • cargo clippy --lib -- -D warnings (in integrations/unftp-sbe)
  • cargo test --lib (in integrations/unftp-sbe)

Are there any user-facing changes?

No API changes. This adjusts internal upload transfer behavior to be more stable under slow/small-packet upload patterns.

AI Usage Statement

This PR was prepared with OpenAI Codex (GPT-5) for code editing and review support.

@Xuanwo Xuanwo requested a review from tisonkun as a code owner February 23, 2026 06:22
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Feb 23, 2026
@Xuanwo Xuanwo merged commit f021b71 into main Feb 23, 2026
334 of 339 checks passed
@Xuanwo Xuanwo deleted the xuanwo/unftp-sbe-copy-loop-mem branch February 23, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants