-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
When closing SFTPInputStream after SFTP read/write completion, the SFTPInputStream.close method is not properly closing the file stream. This can lead to resource leaks.
SeaTunnel Version
2.3.2
SeaTunnel Config
env {
execution.parallelism = 2
job.mode = "BATCH"
}
source{
SftpFile {
path = "/home/dataos/test"
host = "xxxx"
port = 22
user = xxx
password = "****"
file_format_type = "text"
result_table_name = SftpFile_source_4
schema = {
fields {
name = string
age = int
}
}
delimiter = ","
}
}
transform{
Sql{
source_table_name = "SftpFile_source_4"
result_table_name = "Sql-transform-4"
query = "select name,age, DES_ENCRYPT('1111111111',name) des_name from SftpFile_source_4"
}
}
sink {
SftpFile{
file_format_type="text",
path = "/home/test1"
host = "xxx"
port = 22
user = xxx
password = "****"
file_format_type = "text"
field_delimiter=",",
row_delimiter= "/t",
sink_columns = ["name","age","des_name"]
source_table_name="Sql-transform-4"
}
}
Running Command
./bin/seatunnel.sh --config ./task/sftp2sftpError Exception
1.Terminal shows that the SFTP connection is not released.
2.Debugging reveals that the file stream is not closed when the SFTPInputStream.close method is triggered.
Zeta or Flink or Spark Version
No response
Java or Scala Version
jdk8
Screenshots


1.The initialization of SFTPInputStream.class does not pass the file stream to the parent class FSInputStream.class
2.the SFTPInputStream.close method only triggers the FSInputStream.close method, which is unable to close the file stream actually held by SFTPInputStream.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct