Bug #27989

Wrong check in our atomic writes code

Added by Karsten Dambekalns about 4 years ago. Updated about 3 years ago.

Status:Resolved Start date:2011-07-08
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Cache
Target version:TYPO3 Flow Base Distribution - 1.1 RC1
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.0

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 - Task #3755: Concurrency stress testing and cache mechanism New 2009-06-25
related to TYPO3.Flow - Bug #28733: Implement LockManager for avoiding Race Conditions Resolved 2011-08-04
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 ... Resolved 2012-02-02

Associated revisions

Revision 1355fcd7
Added by Karsten Dambekalns about 3 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
Added by Karsten Dambekalns about 3 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 almost 4 years ago

  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns

#2 Updated by Karsten Dambekalns almost 4 years ago

  • Target version deleted (1230)

#3 Updated by Karsten Dambekalns almost 4 years ago

  • Affected Flow version set to FLOW3 1.0.0

#4 Updated by Karsten Dambekalns over 3 years ago

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

#5 Updated by Karsten Dambekalns over 3 years ago

  • Target version changed from 1.1 to 1.0.3

#6 Updated by Gerrit Code Review over 3 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 3 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 3 years ago

  • Status changed from Under Review to Accepted

#9 Updated by Gerrit Code Review over 3 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 3 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 3 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 3 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 3 years ago

  • Target version changed from 1.0.3 to 1.0.4

#14 Updated by Karsten Dambekalns over 3 years ago

  • Target version changed from 1.0.4 to 1.0.5

#15 Updated by Karsten Dambekalns about 3 years ago

  • Target version changed from 1.0.5 to 1.1 RC1

#16 Updated by Gerrit Code Review about 3 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 about 3 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 about 3 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 about 3 years ago

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

Also available in: Atom PDF