fix: close Files.walk stream in GitVersionControlLocalFileStorage.del…#5582
Open
LakshyaMalik18 wants to merge 1 commit into
Open
fix: close Files.walk stream in GitVersionControlLocalFileStorage.del…#5582LakshyaMalik18 wants to merge 1 commit into
LakshyaMalik18 wants to merge 1 commit into
Conversation
Contributor
|
👋 Thanks for your first contribution to Texera, @LakshyaMalik18! You can drive common housekeeping tasks just by leaving a comment. Type the command on its own line. On issues
To find unclaimed work, search Linking sub-issues
You can write references as On pull requests (author only)
You can mention teams as
For the full contribution flow, see CONTRIBUTING.md. |
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.
What changes were proposed in this PR?
GitVersionControlLocalFileStorage.deleteRepocalledFiles.walk(...)without closing the returned stream.Files.walkreturns a closeableStreambacked by an open directory handle, so the handle leaked until GC — which can flake temp-dir deletion on Windows and leak file descriptors on long-lived JVMs.This PR wraps the walk in a try-with-resources block so the stream (and its underlying directory handle) is always closed, even if iteration throws. No behavior change for callers.
Any related issues, documentation, discussions?
Closes #5548
How was this PR tested?
No new tests added. This is a stream-lifecycle fix with no behavior change; existing dataset deletion paths already exercise
deleteRepo.Was this PR authored or co-authored using generative AI tooling?
The code change was taken from the fix described in issue #5548. The PR description was drafted with assistance from Claude (Anthropic).
Generated-by: Claude (Anthropic)