Skip to content

[8.1] Fix SSH jump timeout and leak, SFTP race, log_mask_re TypeError - #179

Merged
penguinolog merged 1 commit into
8.1from
backport-ssh-fixes-8.1
Nov 6, 2026
Merged

penguinolog merged 1 commit into
8.1from
backport-ssh-fixes-8.1

Conversation

@penguinolog

Copy link
Copy Markdown
Collaborator

Backport of #178 (a05c0f8) to the 8.1 line.

  • open_execute_context accepts log_mask_re instead of failing with TypeError; the per-call mask reaches the context repr.
  • connect_timeout also limits the channel opened through a jump host and in proxy_to; NaN is rejected.
  • close() and reconnect() close the jump host connections of a ProxyJump chain, not only the target.
  • Concurrent threads open the SFTP channel once.

Adapted to the 8.1 line:

  • Version notes name 8.1.4; the notes on connect_timeout and on ExecuteContext.log_mask_re are dropped, since both
    are new in 8.1.4.
  • test/fakes.py and the process and channel fixtures in conftest.py are taken from master for the picked tests, with
    pyrefly's test search path.
  • PERF203 is silenced on the guarded close loop; ruff reports it only for targets below Python 3.11.
  • The skipped through-host tests expect the open_channel timeout.

As on master, execute() now always passes log_mask_re to open_execute_context, so an external ExecHelper subclass
that forwards it next to log_mask_re=self.log_mask_re would raise TypeError.

- open_execute_context takes log_mask_re itself instead of failing with
  "multiple values for keyword argument"; execute(), the async execute()
  and execute_together pass their mask to the context repr.
- connect_timeout also limits the channel opened through a jump host and
  in proxy_to; NaN is rejected.
- close() and reconnect() close the jump host connections of a ProxyJump
  chain, the one nearest to the target first.
- Concurrent threads open the SFTP channel once.

Adapted to the 8.1 line:

- Version notes name 8.1.4; the notes on connect_timeout and on
  ExecuteContext.log_mask_re are dropped, since both are new in 8.1.4.
- test/fakes.py and the process and channel fixtures in conftest.py are
  taken from master for the picked tests, with pyrefly's test search path.
- PERF203 is silenced on the guarded close loop, reported for py39 only.
- The skipped through-host tests expect the open_channel timeout.

(cherry picked from commit a05c0f8)
@penguinolog
penguinolog requested a review from dis-xcom as a code owner November 6, 2026 16:07
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 42249310790

Coverage increased (+8.3%) to 78.089%

Details

  • Coverage increased (+8.3%) from the base build.
  • Patch coverage: 34 of 34 lines across 3 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1913
Covered Lines: 1555
Line Coverage: 81.29%
Relevant Branches: 442
Covered Branches: 284
Branch Coverage: 64.25%
Branches in Coverage %: Yes
Coverage Strength: 9.47 hits per line

💛 - Coveralls

@penguinolog
penguinolog merged commit 30968a1 into 8.1 Nov 6, 2026
45 checks passed
@penguinolog
penguinolog deleted the backport-ssh-fixes-8.1 branch November 6, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants