#109709If flushing FileBackend cache fails renamed directory stays behind filling up the filesystem
Description
In very large installations the number of files in for example the TypoScript cache can be huge. I’ve seen several installations with hundreds of thousands of files.
If this is located on a shared file system deleting all the file can be slow and clearing the frontend caches can easily result in a timeout.
The result is that the `*.typoscript.removeXXXXX` directory is left behind with potentially a large number of files. This happens each time the frontend cache is cleared and each time a large directory is left behind. One installation managed to collect over 100GB of garbage with a couple of months.
A solution could be to provide a schedulable command that checks for these temporary directories and removes them; a garbage collector for the (Simple)FileBackend.
It may sound like an edge case but this setup seems to be quite common in large installations.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 1
-
Georg Ringer commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-10-09T18:11:41+00:00" > 10/09/26, 18:11 </span>
Thanks for the report, Jigal.
This should no longer happen since TYPO3 v13.4. With #91768 (“[BUGFIX] Prevent race condition while writing file caches”, merged for main and 13.4)
SimpleFileBackend::flush()no longer renames the cache directory to<dir>.remove<uniqid>before deleting it. Instead, the cache directory stays in place and only the cache files inside it are removed:If a flush is interrupted (e.g. by a timeout on a slow shared file system), the remaining files simply stay in the regular cache directory and are removed by the next flush. No additional
*.removeXXXXXdirectories are created anymore, so garbage can no longer pile up and a dedicated garbage collector command is not needed.The behaviour described here only affects v12.4, which still uses the rename approach.