Skip to content

clean up coder cache #7107

Closed
Closed
@johnstcn

Description

@johnstcn

Problem

We write a whole bunch of data to CODER_CACHE_DIRECTORY but we never seem to clean it out.
This can end up consuming the entire partition, potentially leading to service interruption / outage.

Solution

Periodically clean CODER_CACHE_DIRECTORY.

  • The simplest approach here is probably to remove files older than a configurable threshold.
  • An alternative approach could be to remove files, starting with the oldest first, until the size of the cache directory is below a configurable threshold.
  • Care will need to be taken that we do not perform this task while there are in-progress provisioner jobs, as this could cause them to fail.
    • We may need to provide a mechanism to temporarily "lock" local provisioners and pause them from accepting new jobs. We could potentially accomplish this by simply locking the jobs table.

Metadata

Metadata

Labels

s1Bugs that break core workflows. Only humans may set this.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions