Skip to content

fix: close Files.walk stream in GitVersionControlLocalFileStorage.del…#5582

Open
LakshyaMalik18 wants to merge 1 commit into
apache:mainfrom
LakshyaMalik18:fix/close-files-walk-stream
Open

fix: close Files.walk stream in GitVersionControlLocalFileStorage.del…#5582
LakshyaMalik18 wants to merge 1 commit into
apache:mainfrom
LakshyaMalik18:fix/close-files-walk-stream

Conversation

@LakshyaMalik18

Copy link
Copy Markdown

What changes were proposed in this PR?

GitVersionControlLocalFileStorage.deleteRepo called Files.walk(...) without closing the returned stream. Files.walk returns a closeable Stream backed 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)

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
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

Command What it does
/take Assign the issue to yourself (self-claim it)
/untake Remove yourself as assignee

To find unclaimed work, search is:issue is:open no:assignee — there's no "triage" label; the search filter is the triage state.

Linking sub-issues

Command Where to run it What it does
/sub-issue #12 #13 On the parent Links #12 and #13 as children of this issue
/unsub-issue #12 #13 On the parent Unlinks those children
/parent-issue #5 On the child Sets #5 as this issue's parent
/unparent-issue On the child Removes this issue's parent (auto-detected)
/unparent-issue #5 On the child Removes parent #5 explicitly

You can write references as #12 or bare 12. Cross-repo references like owner/repo#12 aren't supported and are ignored.

On pull requests (author only)

Command What it does
/request-review @user [@user ...] Request reviews from those users
/unrequest-review @user [@user ...] Cancel those review requests

You can mention teams as @org/team, and @copilot works too. Only the PR author can use these commands.

Note: Commands must match exactly — /take this won't work, only /take. Bots are ignored, and you can't self-link an issue or set an issue as its own parent.

For the full contribution flow, see CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Close Files.walk stream in GitVersionControlLocalFileStorage.deleteRepo

1 participant