Skip to content

Clean up tmp dirs of udf and sort while starting up#17377

Merged
JackieTien97 merged 3 commits intomasterfrom
ty/cleanTmp
Mar 27, 2026
Merged

Clean up tmp dirs of udf and sort while starting up#17377
JackieTien97 merged 3 commits intomasterfrom
ty/cleanTmp

Conversation

@JackieTien97
Copy link
Copy Markdown
Contributor

This pull request introduces improvements to resource cleanup and thread safety in the DataNode service, focusing on temporary directories and query data file management. The main changes ensure that stale temporary files and directories are properly cleaned up during startup and shutdown, and that access to shared data structures is thread-safe.

Resource cleanup improvements:

  • Added cleanup of stale sort temporary directories during DataNode startup by introducing a new cleanupSortTmpDir method and invoking it in the setUp process. [1] [2]
  • In TemporaryQueryDataFileService, stale temporary directories are now deleted at startup and shutdown to prevent accumulation of unused files. [1] [2]

Thread safety enhancements:

  • Updated registration of SerializationRecorder objects to use a synchronized list, ensuring thread-safe access to the recorders map.

Minor code cleanup:

  • Removed an outdated TODO comment and improved comment formatting in ExecutableManager. [1] [2]
  • Added a missing import for Collections in TemporaryQueryDataFileService.

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 47.05882% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.78%. Comparing base (d1ae3ce) to head (4f19a31).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...ain/java/org/apache/iotdb/db/service/DataNode.java 0.00% 7 Missing ⚠️
...otdb/db/service/TemporaryQueryDataFileService.java 80.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17377      +/-   ##
============================================
- Coverage     39.78%   39.78%   -0.01%     
  Complexity      312      312              
============================================
  Files          5127     5127              
  Lines        346311   346324      +13     
  Branches      44105    44106       +1     
============================================
- Hits         137785   137774      -11     
- Misses       208526   208550      +24     

☔ View full report in Codecov by Sentry.
📢 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 32f1010 into master Mar 27, 2026
30 checks passed
@JackieTien97 JackieTien97 deleted the ty/cleanTmp branch March 27, 2026 10:46
JackieTien97 added a commit that referenced this pull request Mar 27, 2026
JackieTien97 added a commit that referenced this pull request Mar 28, 2026
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.

1 participant