Skip to content

Fix read lock leak in disk usage statistics - #18807

Merged
JackieTien97 merged 3 commits into
masterfrom
fix/disk-usage-read-lock-leak
Oct 9, 2026
Merged

JackieTien97 merged 3 commits into
masterfrom
fix/disk-usage-read-lock-leak

Conversation

@shuwenwei

Copy link
Copy Markdown
Member

Description

Disk usage statistics acquire a resource read lock when collecting files and acquire another when registering a reader reference for scanning. After scanning, only one lock is released and the file is removed from the cleanup queue, leaving a read lock held even after the statistics utility is closed.

Register one FileReaderManager reference when collecting each closed file, and consistently release it through decreaseFileReaderReference() when skipping a file, finishing a scan, or cleaning up remaining files. Remove the duplicate reference registration before scanning. This balances reader references and resource read locks for both tree-model and table-model disk usage statistics.

Validation

  • Self-reviewed acquisition, skipped-file, scan success/failure, and cleanup paths against the current FileReaderManager implementation.
  • Tests were not run.
Key changed classes
  • DiskUsageStatisticUtil

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.59%. Comparing base (eb0e3f1) to head (cefad09).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ngine/dataregion/utils/DiskUsageStatisticUtil.java 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18807      +/-   ##
============================================
- Coverage     45.59%   45.59%   -0.01%     
  Complexity      712      712              
============================================
  Files          5496     5496              
  Lines        396800   396799       -1     
  Branches      51621    51621              
============================================
- Hits         180929   180908      -21     
- Misses       215871   215891      +20     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JackieTien97
JackieTien97 merged commit 1a83481 into master Oct 9, 2026
35 of 39 checks passed
@JackieTien97
JackieTien97 deleted the fix/disk-usage-read-lock-leak branch October 9, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants