Skip to content

fix(services/sftp): preserve timeout error boundaries#7424

Open
suyanhanx wants to merge 2 commits intomainfrom
fix/sftp-error-propagation
Open

fix(services/sftp): preserve timeout error boundaries#7424
suyanhanx wants to merge 2 commits intomainfrom
fix/sftp-error-propagation

Conversation

@suyanhanx
Copy link
Copy Markdown
Member

Which issue does this PR close?

None. Related to #7391.

Rationale for this change

The SFTP backend currently applies a generic timeout around pooled connection acquisition. In practice that can flatten several different failure stages into the same connection request: timeout error, which makes debugging much harder for callers and downstream users.

This change keeps timeout protection, but moves it to the stage where it belongs.

What changes are included in this PR?

  • add connect_timeout for the SSH connect stage and wire it to openssh::SessionBuilder::connect_timeout(...)
  • add acquire_timeout for waiting on a saturated pooled SFTP connection
  • only apply pooled acquire timeout when the pool is saturated with no idle connections, so normal connection creation still returns the underlying SSH/SFTP error
  • tighten the SSH error message to failed to establish ssh connection
  • add service-local tests for timeout parsing, invalid duration handling, and saturated-pool timeout behavior
  • document the new timeout options in the SFTP service docs

Are there any user-facing changes?

Yes.

SFTP users can now configure connect_timeout and acquire_timeout separately, and connection-stage failures should preserve the underlying SSH/SFTP error more often instead of being flattened into the same generic timeout.

AI Usage Statement

Built with Codex (GPT-5).

@suyanhanx suyanhanx requested a review from Xuanwo as a code owner April 21, 2026 16:23
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Apr 21, 2026
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:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant