ActiveSypport::Cache::FileStore can leave temporary files inside a cache directory. It uses File.atomic_write (link to code). And File.atomic_write uses Tempfile class (link to code) and creates temporary files to check file permissions.
So in the case of process crash (e.g. kill -9) there is a possibility that these files will leave there and will never be deleted (and it occurs on my work).
My proposition - 1) create a special method that will find all these files and will remove them or 2) use existed method ActiveSupport::Cache::FileStore#cleanup to remove these temporary files.
As a side effect it also can remove empty directories.
WDYT? I will create a PR if you agree that this feature is useful.