David Handermann created NIFI-9507:
--------------------------------------
Summary: FetchSFTP spawns multiple keep-alive threads on failed
connections
Key: NIFI-9507
URL: https://issues.apache.org/jira/browse/NIFI-9507
Project: Apache NiFi
Issue Type: Bug
Components: Extensions
Affects Versions: 1.15.1, 1.12.0
Reporter: David Handermann
Assignee: David Handermann
The {{FetchSFTP}} processor relies on the shared {{SFTPTransfer}} class to
handle SFTP communication using the SSHJ library starting in NiFi 1.12.0. The
{{SFTPTransfer}} class instantiates and configures an {{SSHClient}} based on
processor properties, calling the {{connect}} method after initial
configuration.
The {{SSHClient.connect}} method can throw an {{IOException}} on failure to
reach the remote SFTP server, but the NiFi {{SFTPTransfer}} class does not
close in the {{{}SSHClient{}}}. Although {{FetchSFTP}} catches the
{{IOException}} in the parent {{FetchFileTransfer.onTrigger}} method, the
processor never closes the failed {{SSHClient}} because {{SFTPTransfer}} never
assigned the instance variable.
The creation and lifecycle of the {{SSHClient}} inside {{SFTPTransfer}} should
be adjusted to ensure closure of {{SSHClient}} and the associated keep-alive
thread.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)