Req #61492 [NEW]: flock for php 5.3.2 - regression
| From: | spamik at yum dot pl | Date: | Fri, 23 Mar 2012 16:27:16 +0000 |
| Subject: | Req #61492 [NEW]: flock for php 5.3.2 - regression | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-168766@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: 5.3.10
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:flock for php 5.3.2 - regression
Description:
------------
http://www.php.net/manual/en/function.flock.php
"On versions of PHP before 5.3.2, the lock is released also by fclose()
(which
is also called automatically when script finished)."
This is huge regression. I've used with success file locking to check if
another
instance of file is already running putting code like this in front of the
script or append_script
$h55 = fopen($_SERVER['argv'][0],"r");
while(!flock($h55, LOCK_EX + LOCK_NB )) {
echo "cant get lock, die\n";
die();
}
or
$h55 = fopen($_SERVER['argv'][0],"r");
while(!flock($h55, LOCK_EX + LOCK_NB )) {
echo "cant get lock, waiting 10s\n";
sleep(10);
}
I've used it for scripts that had variable running time with a crontab. Now
it
is all impossible thanks to that change :(
--
Edit bug report at https://bugs.php.net/bug.php?id=61492&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61492&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61492&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61492&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=61492&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61492&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=61492&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=61492&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=61492&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=61492&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=61492&r=support
Expected behavior: https://bugs.php.net/fix.php?id=61492&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=61492&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=61492&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=61492&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61492&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61492&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=61492&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=61492&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=61492&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=61492&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=61492&r=mysqlcfg