Bug #66411
closed
New locking API exceptions too generic
Added by Mathias Brodala over 9 years ago.
Updated about 7 years ago.
Sprint Focus:
Stabilization Sprint
Description
The new locking API currently only uses RuntimeException
to hint at errors during lock acquisition.
While this already has the disadvantage of catching other @RuntimeException@s the issue becomes rather clear with the non-blocking example:
try {
$result = $locker->acquire(LockingStrategyInterface::LOCK_CAPABILITY_SHARED | LockingStrategyInterface::LOCK_CAPABILITY_NOBLOCK);
catch (\RuntimeException $e) {
if ($e->getCode() === 1428700748) {
// some process owns the lock, let's do something else meanwhile
}
}
This requires knowing about this special case and knowing the magic number here. A dedicated exception would make this clearer.
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38683
- Sprint Focus set to Stabilization Sprint
- Status changed from Under Review to Resolved
- % Done changed from 50 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF