Issue Feature Rejected

#88279Implement SemaphoreLockStrategy as LOCK_CAPABILITY_NOBLOCK by using $nowait parameter of sem_acquire()

Leonie Philine 05/06/19, 17:35 updated 10/01/19, 21:30

Description

Since PHP 5.6.1, sem_acquire() has a $nowait parameter to make it non-blocking. This parameter is not used in TYPO3.

-> The SemaphoreLockStrategy can be made support LOCK_CAPABILITY_NOBLOCK.

Note: php semaphores are not cluster-ready. A RedisLockStrategy is currently missing in the core and would be a great addition.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 3

  1. Markus Klein commented and changed status New Needs Feedback 05/06/19, 21:00

    Thanks for your report.

    Unfortunately this is only half of the truth.
    The noWait option is not implemented like it is usually on system level. Setting it to true will cause the function to return false if the lock couldn’t be acquired.
    Unfortunately there seems to be no way to distinguish between a failed locking attempt (system related) or because it would block.

    This is the reason why I didn’t implement the noWait feature into the core’s API.
    Other means of locking allow to distinguish properly between “WOULD BLOCK” and an error.

  2. Christian Eßl changed category 10/01/19, 20:11

  3. Markus Klein changed status Needs Feedback Rejected 10/01/19, 21:30