Skip to content

Move archive_garbage_collector.py temporary file writing from /var/log to temporary directory #1823

@coderabbitai

Description

@coderabbitai

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

  1. Doesn't respect log directory configuration: The archive_garbage_collector.py writes the recovery file using clp_config.logs_directory instead of the CLP_LOGS_DIR environment 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).

  2. Violates convention: Writing temporary files to /var/log violates our latest convention of writing temporary files to temporary directories.

  3. Unnecessary host mapping: The temporary recovery file doesn't need to be mapped onto the host filesystem.

Affected Code

Required Changes

  1. Update archive_garbage_collector.py to write the recovery file to a proper temporary directory instead of /var/log.
  2. Update Docker Compose orchestration to reflect this change.
  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions