JackieTien97 opened a new pull request, #17377: URL: https://github.com/apache/iotdb/pull/17377
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]](diffhunk://#diff-61bde9bbfe133b3e02f980faa06010a7f1dd5ea7f7417bd0bcad6375727878efR768-R776) [[2]](diffhunk://#diff-61bde9bbfe133b3e02f980faa06010a7f1dd5ea7f7417bd0bcad6375727878efR831-R833) - In `TemporaryQueryDataFileService`, stale temporary directories are now deleted at startup and shutdown to prevent accumulation of unused files. [[1]](diffhunk://#diff-cae1cd82384cac864ce43e7be67e3f373d924c1cb6064b137952b9e8a9d8ff31R112-R116) [[2]](diffhunk://#diff-cae1cd82384cac864ce43e7be67e3f373d924c1cb6064b137952b9e8a9d8ff31L120-R129) **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]](diffhunk://#diff-cfe894dbb5968b72693aee8059ec56f538ae5af3daf83c0856efdf79d1e17889L84) [[2]](diffhunk://#diff-cfe894dbb5968b72693aee8059ec56f538ae5af3daf83c0856efdf79d1e17889L226-R226) - Added a missing import for `Collections` in `TemporaryQueryDataFileService`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
