Project

General

Profile

Actions

Bug #69936

closed

Semaphore locking: PHP hangs with 3 concurrent requests

Added by Christian Weiske about 9 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-09-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

We have a TYPO3 6.2 instance running on PHP-CGI 5.4.40 on Debian 7, using semaphore locking.

Doing 3 concurrent requests with apache bench to the frontend index.php page with an empty page cache (or page.config.no_cache=1 in TypoScript) leaves one of the three CGI processes hanging forever using 100% CPU, with the following strace messages:

...
semop(439910402, {{0, -1, SEM_UNDO}}, 1) = -1 EINVAL (Invalid argument)
semop(439910402, {{0, -1, SEM_UNDO}}, 1) = -1 EINVAL (Invalid argument)
...

We found that removing the sem_remove() from the typo3_src/typo3/sysext/core/Classes/Locking/Locker.php destructor solves the issue and we experience no more hanging processes.

This is in line with http://php.net/manual/en/function.sem-remove.php#113540 which states

sem_remove() shouldn't be part of a normal cleanup/teardown and should be called very rarely due to bugs in the implementation.

The destructor code was introduced in #40420, "[TASK] Improve Locker".


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #40420: Semaphore based locking returns warningClosed2012-08-30

Actions
Actions

Also available in: Atom PDF