buildgrid.server.app.commands.cmd_janitor module

CAS Janitor

Cleanup daemon which is responsible for picking up any mess left by the regular cleaner.

The regular cleaner is required to synchronize between the index and the storage, and so it is possible to get into a state where the blob is removed from the index but not removed from the storage (eg. in the event of an error when removing the blob from storage after removing it’s index entry).

The Janitor takes care of this situation by regularly iterating over the entire storage and removing any blobs which aren’t referenced by an index. This ensures that any hanging blobs are removed in a timely manner and the storage space consumption doesn’t spiral up out of control.