[BUGFIX] Multiple fixes for Locking API and TSFE locking 40/38840/13
authorMarkus Klein <klein.t3@reelworx.at>
Tue, 21 Apr 2015 00:33:04 +0000 (02:33 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 27 Apr 2015 17:10:40 +0000 (19:10 +0200)
commita1ed7cefc902cb9bd0e0451c550fe92ea3302033
tree0e6a82a03c51c9e9706fdc5740bb26d97269b03c
parentd984baa8e799669da05d561f2066bb0fb04d40ba
[BUGFIX] Multiple fixes for Locking API and TSFE locking

* Retrieve correct LockingStrategy for requested capabilities
* Prefix lock filenames to make them better visible in the folder
* Make all LockStrategies destroyable
* Semaphore locking now uses ftok() to generate a unique id
* Make the Mbox lock independent of the target file
* Introduce an access lock for each of the TSFE cache locks

We decrease the priority of Semaphore locking since this can
be pretty dangerous for the average user. If something goes
really wrong in the webserver (which is out of our control),
we might leave behind stale semaphores, which might cause
a permanent deadlock for an instance, which can only be resolved
by a server admin.
We might raise the priority again at a later point in time,
when we can provide better means of cleanup.

The new access locks protects the access to the cache locks in TSFE
now, which allows us to safely remove those cache locks after using
them. This way we don't spam the system with loads of locks.

Releases: master
Resolves: #66503
Change-Id: Ia19e6e7d47d7941e01785f5a6b67746a6c0fa368
Reviewed-on: http://review.typo3.org/38840
Reviewed-by: Andreas Allacher <andreas.allacher@gmx.at>
Tested-by: Andreas Allacher <andreas.allacher@gmx.at>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Classes/Locking/FileLockStrategy.php
typo3/sysext/core/Classes/Locking/LockFactory.php
typo3/sysext/core/Classes/Locking/LockingStrategyInterface.php
typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php
typo3/sysext/core/Classes/Locking/SimpleLockStrategy.php
typo3/sysext/core/Classes/Mail/MboxTransport.php
typo3/sysext/core/Tests/Unit/Locking/FileLockStrategyTest.php
typo3/sysext/core/Tests/Unit/Locking/Fixtures/DummyLock.php
typo3/sysext/core/Tests/Unit/Locking/LockFactoryTest.php
typo3/sysext/core/Tests/Unit/Locking/SimpleLockStrategyTest.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php