Closed
Description
Symfony version(s) affected
v5.4.0-BETA1
Description
In some cases the lock component fails to acquire a semaphore. In this scenario it will try to remove a non existent semaphore, which results in a PHP warning:
sem_remove(): SysV semaphore [id] does not (any longer) exist
.
This seems to be related to the recent change in 5.4 to use semaphores instead of flock in the LockRegistry
How to reproduce
PHP Version: 7.4
On my machine the acquiring failure can be reproduced in this scenario:
Have two concurrent processes: Process A and Process B
- Process A wins the lock race and acquires a semaphore
- Process B will not acquire a lock, but will wait until the semaphore becomes available again (acquire in blocking mode)
- Process A will remove the the semaphore at the end of the request.
- Process B will continue, but the acquiring fails since the semaphore is removed in Process A
- Process B will try to remove the semaphore, but since it does not exist this results in the PHP warning
Possible Solution
No response
Additional Context
No response