Actions
Bug #57136
closedMitigate race condition when clearing file caches
Start date:
2014-03-21
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
When file caches are flushed, the cache directory is also deleted.
Now when a second request comes in and creates the caches
it happens that the cache directory of a given cache is still there
for this cache when calling setCache in the SimpleFileBackend,
but is deleted by the first request afterwards.
Now the cache directory for the second request does not exist
and setting cache entries will fail.
Debug trace of the two requests:
[21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b5674733 setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b5674733 setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b5674733 setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e setCache [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e flush /htdocs/master/typo3temp/Cache/Code/cache_core/ [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e create /htdocs/master/typo3temp/Cache/Code/cache_core/ [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b566855e flush /htdocs/master/typo3temp/Cache/Data/cache_classes/ [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b5674733 exception [21-Mar-2014 10:50:14 Europe/Berlin] 532c0b5674733 exception [21-Mar-2014 10:50:14 Europe/Berlin] PHP Fatal error: Uncaught exception 'TYPO3\CMS\Core\Error\Exception' with message 'PHP Warning: file_put_contents(/htdocs/master/typo3temp/Cache/Data/cache_classes/532c0b56e0596.temp): failed to open stream: No such file or directory in /TYPO3/master/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php line 246' in /TYPO3/master/typo3/sysext/core/Classes/Error/ErrorHandler.php:111 Stack trace: #0 [internal function]: TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'file_put_conten...', '/Volumes/Data/U...', 246, Array) #1 /TYPO3/master/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php(246): file_put_contents('/Volumes/Data/U...', '/Volumes/Data/U...') #2 /TYPO3/master/typo3/sysext/core/Classes/Cache/Frontend/StringFrontend.php(60): TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend->set('typo3_cms_core_...', '/Volumes/Data/U...', Arra in /TYPO3/master/typo3/sysext/core/Classes/Error/ErrorHandler.php on line 111 [21-Mar-2014 10:50:15 Europe/Berlin] 532c0b566855e create /htdocs/master/typo3temp/Cache/Data/cache_classes/ [21-Mar-2014 10:50:15 Europe/Berlin] 532c0b566855e flush /htdocs/master/typo3temp/Cache/Data/l10n/ [21-Mar-2014 10:50:15 Europe/Berlin] 532c0b566855e create /htdocs/master/typo3temp/Cache/Data/l10n/ [21-Mar-2014 10:50:15 Europe/Berlin] 532c0b566855e flush /htdocs/master/typo3temp/Cache/Code/cache_phpcode/ [21-Mar-2014 10:50:15 Europe/Berlin] 532c0b566855e create /htdocs/master/typo3temp/Cache/Code/cache_phpcode/ [21-Mar-2014 10:50:15 Europe/Berlin] 532c0b566855e flush /htdocs/master/typo3temp/Cache/Code/fluid_template/ [21-Mar-2014 10:50:15 Europe/Berlin] 532c0b566855e create /htdocs/master/typo3temp/Cache/Code/fluid_template/
Mitigate this by immediately recreating the cache directory
Files
Actions