Close the keystore file in SslContextAwareAbstractSource - #506
Merged
Merged
Conversation
The keystore was loaded through a `FileInputStream` that was never closed, both when validating the configuration and each time an `SSLContext` was created. The leaked handle keeps the keystore locked on Windows until the stream is garbage collected, which makes tests that place the keystore in a JUnit `@TempDir` fail during cleanup. Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
ppkarwasz
enabled auto-merge (squash)
September 17, 2026 14:16
ppkarwasz
disabled auto-merge
September 17, 2026 14:16
rgoers
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SslContextAwareAbstractSourceloaded the keystore through aFileInputStreamthat was never closed, both when validating the configuration inconfigureSsland each timegetSslContextcreated anSSLContext. The leaked handle keeps the keystore locked on Windows until the stream is garbage collected.This surfaced in apache/logging-flume-http#7:
TestHTTPSourcewas migrated to JUnit 5, whose@TempDircleanup reports files it cannot delete, and the Windows build failed on the still-openkeystore.jks. JUnit 4'sTemporaryFoldersilently ignored the same failure here.Changes
TestSslContextAwareAbstractSource, which checks the SSL context creation, the password validation, that the keystore can be deleted after use (the Windows symptom) and, on Linux, that no descriptor in/proc/self/fdstill points at the keystore. Against the unfixed code the last test fails with two open descriptors.🤖 Generated with Claude Code