Skip to content

[Hotfix] [Connector-file-ftp] Fix the problem of writing ftp failure #4702

@MonsterChenzhuo

Description

@MonsterChenzhuo

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

  1. When FTPClient creates a directory, it cannot set permissions directly. As a result, the created directory cannot be recursive, and the whole directory is all messed up.

图片

图片

Solution: You can send a SITE CHMOD command to change the permissions of the directory immediately after creating the directory.
  1. Problem 2: Recursive calls in the mkdirs method may cause the working directory not to return to its original state after each recursive call. This may cause client.changeWorkingDirectory(parentDir) to return false in some cases.
    Solution: The working directory can be restored after each recursive call

After the code repair is completed, execute:
图片

How to reproduce this issue locally:
Pull this branch to your local machine:#4647
First step: Disable some test cases (reduce debugging execution waiting time, it is recommended to only execute lines 126 to 128)
图片
Second step: Use breakpoint debugging to prevent the container from being released
Third step: Log into the FTP container to view the content that has been written
图片

SeaTunnel Version

v2.3.1

SeaTunnel Config

null

Running Command

null

Error Exception

null

Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions