Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-294: Fix memory leaks in SftpFileSystemProvider #295

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

tomaswolf
Copy link
Member

@tomaswolf tomaswolf commented Dec 19, 2022

SftpFileSystem.getClient() returns reference-counted wrapper instances that need to be closed to avoid a memory leak via ThreadLocals. Make sure that the streams returned by SftpFileSystemProvider.newInputStream() and newOutputStream() do close the client. Also fix SftpFileSystemProvider.copy() to close the SftpClient it uses.

SftpFileSystemProvider.newDirectoryStream() and newFileChannel() already do close the SftpClient used.

Fix the SftpFileSystemTest to properly close SftpClients and DirectoryStreams.

Fixes #294.

SftpFileSystem.getClient() returns reference-counted wrapper
instances that need to be closed to avoid a memory leak via
ThreadLocals. Make sure that the streams returned by
SftpFileSystemProvider.newInputStream() and newOutputStream()
do close the client. Also fix SftpFileSystemProvider.copy() to
close the SftpClient it uses.

SftpFileSystemProvider.newDirectoryStream() and newFileChannel()
already do close the SftpClient used.

Fix the SftpFileSystemTest to properly close SftpClients and
DirectoryStreams.

Bug: apache#294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Leak in SftpFileSystemProvider
1 participant