Skip to content

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

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

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.

@codecov-commenter

codecov-commenter commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.19%. Comparing base (564ccdb) to head (cfd4507).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...til/dataset/GitVersionControlLocalFileStorage.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5582      +/-   ##
============================================
+ Coverage     52.17%   52.19%   +0.01%     
- Complexity     2482     2485       +3     
============================================
  Files          1068     1068              
  Lines         41311    41312       +1     
  Branches       4439     4439              
============================================
+ Hits          21556    21561       +5     
+ Misses        18490    18488       -2     
+ Partials       1265     1263       -2     
Flag Coverage Δ *Carryforward flag
access-control-service 64.61% <ø> (ø)
agent-service 33.76% <ø> (ø) Carriedforward from 564ccdb
amber 53.31% <0.00%> (+0.02%) ⬆️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.06% <ø> (ø)
file-service 38.32% <ø> (ø)
frontend 46.42% <ø> (ø) Carriedforward from 564ccdb
pyamber 90.72% <ø> (ø) Carriedforward from 564ccdb
python 90.75% <ø> (ø) Carriedforward from 564ccdb
workflow-compiling-service 58.69% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xuang7

xuang7 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Closing this as a duplicate of #5575.

@xuang7 xuang7 closed this Jun 9, 2026
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

3 participants