Bug #32707

Bad Bad FileBackend

Added by Daniel Poetzinger almost 10 years ago. Updated over 8 years ago.

Status:
Accepted
Priority:
Must have
Category:
Cache
Start date:
2011-12-19
Due date:
% Done:

0%

Estimated time:
2.00 h
PHP Version:
Has patch:
No
Complexity:
easy

Description

http://git.typo3.org/FLOW3/Packages/TYPO3.FLOW3.git?a=blob;f=Classes/Cache/Backend/FileBackend.php;h=ab724f855e1d6a3007056d0010c6ba00138a01e9;hb=8daf64af85dbcd3030cc3d259e262d70d50daf92

The FileBackend is not working under middle to high load and also not working relyable on shared filesystems

The main reason is the set function:
- All fileoperations need to be atomic - so why is ->remove() called and after this the file is written to some temp file and then renamed.
=> It should work by just removing the ->remove call, the rename method will replace the existing entry.

Also the while (!rename($temporaryCacheEntryPathAndFilename, $cacheEntryPathAndFilename) && $i < 5) seems to be unnecessary - why is this done?

Other improvements might be to get rid of the extra cache meta data for expire time - maybe using filemtime is faster at the end (it avoids expensive file_get_contents two times)


Related issues

Related to TYPO3.Flow - Bug #27989: Wrong check in our atomic writes codeResolvedKarsten Dambekalns2011-07-08

Actions
Precedes (1 day) TYPO3 Core - Bug #32709: Make FileBackend more stableClosed2011-12-212011-12-21

Actions
#1

Updated by Daniel Poetzinger almost 10 years ago

the fixme mentioned in typo3 core might be also relevant

// @FIXME: At least the result of rename() should be handled here, report to FLOW3 could be fixed as well

#2

Updated by Karsten Dambekalns almost 10 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.1
#3

Updated by Karsten Dambekalns over 9 years ago

  • Target version changed from 1.1 to 1.1 RC1
#4

Updated by Karsten Dambekalns over 9 years ago

  • Target version changed from 1.1 RC1 to 2.0 beta 1
#5

Updated by Karsten Dambekalns almost 9 years ago

  • Target version changed from 2.0 beta 1 to 2.0
#6

Updated by Robert Lemke over 8 years ago

  • Target version changed from 2.0 to 2.0.1

Also available in: Atom PDF