-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Detect and close I/O leaks in the native FS implementations #26087
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
Conversation
d6a8685 to
d310a30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds I/O stream leak detection functionality to the native filesystem. Key changes include the introduction of several LeakDetecting* wrapper classes to monitor resource usage, updates to the filesystem factory and module for conditional activation, and corresponding configuration and tests updates.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/trino-filesystem/src/main/java/io/trino/filesystem/leakdetection/TrackedLocationState.java | Added state tracking with stack trace capture for leak detection. |
| lib/trino-filesystem/src/main/java/io/trino/filesystem/leakdetection/LeakDetecting*.java | Introduced output and input stream/file wrappers incorporating leak detection. |
| lib/trino-filesystem-manager/src/test/java/io/trino/filesystem/manager/TestFileSystemConfig.java | Updated tests to verify the new leak detection configuration. |
| lib/trino-filesystem-manager/src/main/java/io/trino/filesystem/manager/FileSystemModule.java | Integrated leak detection based on configuration and CI environment variable. |
| lib/trino-filesystem-manager/src/main/java/io/trino/filesystem/manager/FileSystemConfig.java | Added new configuration property to enable/disable leak detection. |
Comments suppressed due to low confidence (1)
lib/trino-filesystem-manager/src/main/java/io/trino/filesystem/manager/FileSystemModule.java:169
- [nitpick] Consider adding a comment explaining why the 'CONTINUOUS_INTEGRATION' environment variable is used to activate leak detection, so future maintainers understand this design decision.
boolean leakDetectionEnabled = getenv("CONTINUOUS_INTEGRATION") != null;
lib/trino-filesystem/src/main/java/io/trino/filesystem/leakdetection/TrackedLocationState.java
Outdated
Show resolved
Hide resolved
d310a30 to
ad2e69c
Compare
raunaqmorarka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea
ad2e69c to
65e8eb5
Compare
It is enable by default in the CI to report detected leaks
65e8eb5 to
6dfa435
Compare
| delegate = new TracingFileSystemFactory(tracer, delegate); | ||
|
|
||
| // Enable leak detection if configured or if running in a CI environment | ||
| boolean trackingDetectionEnabled = getenv("CONTINUOUS_INTEGRATION") != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make this the default for the config, allowing it to be overridden in either case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will follow up
It's enabled by default in the CI
Description
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: