|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-05 04:17 UTC] kalle@php.net
[2008-10-26 19:15 UTC] jani@php.net
[2008-11-03 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 22:00:01 2025 UTC |
Description: ------------ Well, better explained when seeing the code. Not acting as expected via web browser as the both instances execute as the lock file was not created by another instance but doing it well via shell console. Same problem using clearstatcache() function. Reproduce code: --------------- // LOCK_FILE was defined to /tmp/test.lock // creating the lock file if(file_exists(LOCK_FILE)) { echo "ANOTHER INSTANCE RUNNING\n"; exit(1); } else { touch(LOCK_FILE); } /* any action that takes time*/ echo "running\n"; sleep(5); // simulating slow scripts echo "done\n"; if(file_exists(LOCK_FILE)) { unlink(LOCK_FILE); } else { echo "I think someone deleted the lock file\n"; } Expected result: ---------------- To see "running\ndone\n" in one instance, and "ANOTHER INSTANCE RUNNING\n" if another instance try to execute at the same time. Actual result: -------------- Via shell everything works as well but via web browser both instances run as the lock file doesnt exist.