You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked the #294 and merge the fix code to V2.8.0
That fixed the old issue, but there is still a issue here.
If a exception happen in FilterInputStream init, for example, a "No such file" exception happen in client.read(p.toString(), modes), then lead to constructor init failure of FilterInputStream return new FilterInputStream(client.read(p.toString(), modes))
If that happen, the code seems will not call the "client.close()", so SftpClient will not close and keep increasing, finally lead to a OOM
2024-05-11 12:00:02,311 INFO [LoggerStream] - SFTP error (SSH_FX_NO_SUCH_FILE): No such file
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.throwStatusException(AbstractSftpClient.java:217)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.checkAttributesResponse(AbstractSftpClient.java:306)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.checkAttributes(AbstractSftpClient.java:284)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.stat(AbstractSftpClient.java:1001)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.SftpInputStreamAsync.(SftpInputStreamAsync.java:69)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.read(AbstractSftpClient.java:1189)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.fs.SftpFileSystem$Wrapper.read(SftpFileSystem.java:491)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.fs.SftpFileSystem$Wrapper.read(SftpFileSystem.java:483)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.newInputStream(SftpFileSystemProvider.java:525)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at java.nio.file.Files.newInputStream(Files.java:152)
Version
V2.8.0
Bug description
I checked the #294 and merge the fix code to V2.8.0
That fixed the old issue, but there is still a issue here.
If a exception happen in FilterInputStream init, for example, a "No such file" exception happen in client.read(p.toString(), modes), then lead to constructor init failure of FilterInputStream
return new FilterInputStream(client.read(p.toString(), modes))
If that happen, the code seems will not call the "client.close()", so SftpClient will not close and keep increasing, finally lead to a OOM
2024-05-11 12:00:02,311 INFO [LoggerStream] - SFTP error (SSH_FX_NO_SUCH_FILE): No such file
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.throwStatusException(AbstractSftpClient.java:217)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.checkAttributesResponse(AbstractSftpClient.java:306)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.checkAttributes(AbstractSftpClient.java:284)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.stat(AbstractSftpClient.java:1001)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.SftpInputStreamAsync.(SftpInputStreamAsync.java:69)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.impl.AbstractSftpClient.read(AbstractSftpClient.java:1189)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.fs.SftpFileSystem$Wrapper.read(SftpFileSystem.java:491)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.fs.SftpFileSystem$Wrapper.read(SftpFileSystem.java:483)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at org.apache.sshd.sftp.client.fs.SftpFileSystemProvider.newInputStream(SftpFileSystemProvider.java:525)
2024-05-11 12:00:02,311 INFO [LoggerStream] - at java.nio.file.Files.newInputStream(Files.java:152)
Actual behavior
Memory leak happen
Expected behavior
No Memory Leak
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered: