Issue Bug Closed

#67238Avoid race conditions in typo3temp/Cache

Bernhard Kraft 06/02/15, 14:26 updated 10/02/18, 11:44

Description

Race conditions can occur when the cache in typo3temp/Cache gets cleared, for example by using the Install Tool “Clear all caches” button. The cache is currently cleared using GeneralUtility::rmdir() which does a directory traversal and unlinks all contained files. Instead GeneralUtility::flushDirectory() should get used. This method renames the directory into a temp-dir name and then removes the temp-dir using GeneralUtility:rmdir(). But as the rename is atomic there will be no race condition where files within typo3temp/Cache/ will get recreated while the cache-clearing process is still running.

Reviews 3