Created on 06-13-2018 02:02 PM - edited 09-16-2022 06:20 AM
Hello there,
I'm using nifi to retrieve files from an sftp server. This server grants multiple access to multiple users.
Nifi accesses the server as different users to dowload files.
It seems that ListSftp processor doesn't close connection, infact - having a maximum amount of connections per ip- i get a an acces error saying i reached maximum amount of connections per ip.
checking the source code, in
package org.apache.nifi.processors.standard.util.SFTPTransfer
in
getListing
method
I cannot see any
close()
request.
The only
close()
method call i can see is in
getChannel
method, but i guess this is not the case after listing content in sftp.
Is this a known issue, or am I missing something?
Thanks a lot for your help!
Created 06-13-2018 02:25 PM
ListSFTP extends ListFileTransfer and that class has performListing() which does:
final FileTransfer transfer = getFileTransfer(context);
final List<FileInfo> listing;
try {
listing = transfer.getListing();
} finally {
IOUtils.closeQuietly(transfer);
}
The FileTransfer here is the SFTPTransfer, so it is being closed in a finally block every time.
Created 06-13-2018 02:25 PM
ListSFTP extends ListFileTransfer and that class has performListing() which does:
final FileTransfer transfer = getFileTransfer(context);
final List<FileInfo> listing;
try {
listing = transfer.getListing();
} finally {
IOUtils.closeQuietly(transfer);
}
The FileTransfer here is the SFTPTransfer, so it is being closed in a finally block every time.