-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Background
In PR #1817, we identified that archive_garbage_collector.py writes temporary files to an inappropriate location.
Related PR: #1817
Related Comment: #1817 (comment)
Problems
-
Doesn't respect log directory configuration: The
archive_garbage_collector.pywrites the recovery file usingclp_config.logs_directoryinstead of theCLP_LOGS_DIRenvironment variable that is used by the logger. This means it would write to a different location than expected (e.g., would write to the directory specified in clp-config.yaml rather than/var/log/garbage_collector). -
Violates convention: Writing temporary files to
/var/logviolates our latest convention of writing temporary files to temporary directories. -
Unnecessary host mapping: The temporary recovery file doesn't need to be mapped onto the host filesystem.
Affected Code
archive_garbage_collector.py:205: Creates recovery file usingclp_config.logs_directorygarbage_collector.py:39: Sets up logging usingCLP_LOGS_DIRenvironment variable
Required Changes
- Update
archive_garbage_collector.pyto write the recovery file to a proper temporary directory instead of/var/log. - Update Docker Compose orchestration to reflect this change.
- Update Helm chart orchestration if needed.
Suggested Solution
Consider using a dedicated temporary directory (e.g., /tmp/clp/garbage_collector/) or passing a separate temporary directory configuration to the garbage collector.
Reported by: @junhaoliao