Bug #27989

Wrong check in our atomic writes code

Added by Karsten Dambekalns over 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Must have
Category:
Cache
Start date:
2011-07-08
Due date:
% Done:

100%

PHP Version:
Has patch:
No
Complexity:

Description

This is from Cache\Backend\FileBackend, similar stuff is patched into Doctrine's ProxyFactory:

if ($result === FALSE) throw new \TYPO3\FLOW3\Cache\Exception('The temporary cache file "' . $temporaryCacheEntryPathAndFilename . '" could not be written.', 1204026251);
$i = 0;
$cacheEntryPathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
while (!rename($temporaryCacheEntryPathAndFilename, $cacheEntryPathAndFilename) && $i < 5) {
    $i++;
}
if ($result === FALSE) throw new \TYPO3\FLOW3\Cache\Exception('The cache file "' . $cacheEntryPathAndFilename . '" could not be written.', 1222361632);

The second check for $result is moot, because it's not set in the rename loop...


Related issues

Related to TYPO3.Flow - Bug #28733: Implement LockManager for avoiding Race Conditions Resolved 2011-08-04
Related to TYPO3.Flow - Task #3755: Concurrency stress testing and cache mechanism New 2009-06-25
Related to TYPO3.Flow - Bug #32707: Bad Bad FileBackend Accepted 2011-12-19
Related to TYPO3.Flow - Bug #33621: Filebackend reports error when trying to rename file due to concurrent proccesses Resolved 2012-02-02

Associated revisions

Revision 1355fcd7 (diff)
Added by Karsten Dambekalns over 7 years ago

[BUGFIX] Fix wrong check in atomic writes code

Fixes a wrong check in Cache\FileBackend and RsaWalletServicePhp
as well as a bunch of one-line if blocks.

Change-Id: Ice9f39bd2912e5af7cfe1aa73b7315c54ddaafa5
Fixes: #27989
Related: #34875
Releases: 1.1, 1.2

Revision 3664972e (diff)
Added by Karsten Dambekalns over 7 years ago

[BUGFIX] Fix wrong check in atomic writes code

Fixes a wrong check in Cache\FileBackend and RsaWalletServicePhp
as well as a bunch of one-line if blocks.

Change-Id: Ice9f39bd2912e5af7cfe1aa73b7315c54ddaafa5
Fixes: #27989
Related: #34875
Releases: 1.1, 1.2

History

#1 Updated by Karsten Dambekalns about 8 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns

#2 Updated by Karsten Dambekalns almost 8 years ago

  • Target version deleted (1230)

#4 Updated by Karsten Dambekalns over 7 years ago

  • Target version set to 1.1
  • Has patch set to No

#5 Updated by Karsten Dambekalns over 7 years ago

  • Target version changed from 1.1 to 1.0.3

#6 Updated by Gerrit Code Review over 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8786

#7 Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8787

#8 Updated by Karsten Dambekalns over 7 years ago

  • Status changed from Under Review to Accepted

#9 Updated by Gerrit Code Review over 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8931

#10 Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8931

#11 Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8787

#12 Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8931

#13 Updated by Karsten Dambekalns over 7 years ago

  • Target version changed from 1.0.3 to 1.0.4

#14 Updated by Karsten Dambekalns over 7 years ago

  • Target version changed from 1.0.4 to 1.0.5

#15 Updated by Karsten Dambekalns over 7 years ago

  • Target version changed from 1.0.5 to 1.1 RC1

#16 Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12187

#17 Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12187

#18 Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/12398

#19 Updated by Karsten Dambekalns over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF