Bug #13490 Updated: Semaphores don't release automatically

From: Date: Mon, 14 Jan 2002 01:27:43 +0000
Subject: Bug #13490 Updated: Semaphores don't release automatically
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76951@lists.php.net to get a copy of this message
ID: 13490 Updated by: swm Old Summary: Semaphores don't release automatically Reported By: m@savich.ru Old Status: Closed Status: Open Bug Type: Semaphore related Operating System: FreeBSD 4.1.1 PHP Version: 4.0.6 New Comment: My bad. Re-opened. Previous Comments: ------------------------------------------------------------------------ [2002-01-13 14:52:51] m@savich.ru http://www.php.net/manual/ru/function.sem-acquire.php: "After processing a request, any semaphores acquired by the process but not explicitly released will be released automatically and a warning will be generated." Therefore, it is NOT intended behaviour, because in my situation semaphores DON'T release automatically. And any failure in php script causes apache to hang up in few seconds, because semaphore is acquired by dead script and all other instances can't work. This really is bug. :-( ------------------------------------------------------------------------ [2002-01-13 08:35:48] swm@php.net This is intended behaviour. This is how semaphores work. =) Use sem_remove() to remove semaphores. ------------------------------------------------------------------------ [2001-09-28 19:03:32] m@savich.ru simplest script: <? $id = sem_get(0xff03e3); sem_acquire($id); ?> modules: './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mysql' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-sockets' description: When i run that script for the first time, warning doesnt appear, as it is described in manual. All the other calls hang apache processes without any chance for semaphore to unlock. However, if i try such variant: <? set_time_limit(0); $id = sem_get(0xff03e3); sem_acquire($id); sleep(1); sem_release($id); ?> everything works perfectly for single calls, but when I run my crash-test, which calls the php script 200 times at once, it hangs the semaphore again and many apache processes stay frozen. I think, the reason is incorrect request finalization. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13490&edit=1

« previous php.dev (#76951) next »