cascache: atomically save size via tmpdir instead

Description

Instead of doing the atomic 'mv into place' using a temporary file in the 'cas' directory, use the sibling 'tmp' directory instead.

This will avoid the situation where CleanupJob encounters a temporary file in the cas directory. This can happen because CleanupJob does not always run with an exclusive lock on the cas directory, and BuildQueue updates the cache size whenever a BuildJob completes.

Changes proposed in this merge request:

  • Use tempdir=self.tmpdir when saving the cache size file.

This merge request, when approved, will close:

Helps #957 (closed)


Edited by Angelos Evripiotis

Merge request reports

Loading