Skip to content

ssh: ssh_sftp improve window related error handling #10035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

u3s
Copy link
Contributor

@u3s u3s commented Jul 9, 2025

No description provided.

@u3s u3s self-assigned this Jul 9, 2025
@u3s u3s added the team:PS Assigned to OTP team PS label Jul 9, 2025
Copy link
Contributor

github-actions bot commented Jul 9, 2025

CT Test Results

    2 files     29 suites   18m 46s ⏱️
  481 tests   475 ✅  6 💤 0 ❌
1 686 runs  1 660 ✅ 26 💤 0 ❌

Results for commit 99ff120.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@u3s u3s requested a review from Copilot July 9, 2025 15:15
Copilot

This comment was marked as outdated.

@u3s u3s force-pushed the kuba/ssh/window_badmatch/GH-9655/OTP-19707 branch from 864b211 to 11ccf21 Compare July 10, 2025 10:34
@u3s u3s requested a review from Copilot July 10, 2025 10:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors SFTP file operations to use the maybe ... end construct with ?= for streamlined error matching and propagation.

  • Replaces case statements and direct = matches in open/recv_window/send_window with maybe blocks
  • Updates read_file, write_file, read_repeat, read_buf, write_to_remote_tar, and write_buf to the new pattern
  • Consolidates cleanup and error return logic under unified maybe expressions
Comments suppressed due to low confidence (1)

lib/ssh/src/ssh_sftp.erl:1027

  • Add tests for error paths in the new maybe blocks (e.g., open/recv_window/send_window failures) to ensure correct propagation and cleanup behavior.
    maybe

@u3s u3s force-pushed the kuba/ssh/window_badmatch/GH-9655/OTP-19707 branch from 11ccf21 to 99ff120 Compare July 10, 2025 10:55
@u3s u3s requested a review from IngelaAndin July 10, 2025 11:26
@u3s u3s added the testing currently being tested, tag is used by OTP internal CI label Jul 10, 2025
@u3s u3s requested a review from IngelaAndin July 15, 2025 13:27
@u3s u3s merged commit e517e64 into erlang:maint Jul 15, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Match error in ssh_sftp:write_file when connection gets closed concurrently
2 participants