Last modified: 2012-05-03 02:42:46 UTC
When uploading a new version of an existing file. I always got the following message: Could not acquire lock for key "est5rsvfknamj8y9bqldhv8tszzpfqe".
tagging for platformeng to see if anyone can repro a non-windows platform.
[mid-air collision] cc'ing aaron since this is presumably file backend related (they did say 1.19-svn in version field).
Update my environment information as below: OS: Windows Server 2008 R2 MediaWiki: 1.19alpha (r106928) PHP: 5.3.6 (apache2handler) Database: PostgreSQL 8.3.14 Thanks for your help!
(In reply to comment #0) > When uploading a new version of an existing file. > I always got the following message: > > Could not acquire lock for key "est5rsvfknamj8y9bqldhv8tszzpfqe". Does this happen when uploading a file under a name that nothing uses?
(In reply to comment #4) > Does this happen when uploading a file under a name that nothing uses? No, I can upload file with a brand-new name.
Can you test a bit of PHP code, e.g.: $fp1 = fopen( <path to a file in a dir that exists>, 'a+' ); $ok1 = flock( $fp1, LOCK_SH | LOCK_NB ); $fp2 = fopen( <path to same file>, 'a+' ); $ok2 = flock( $fp2, LOCK_EX | LOCK_NB ); And look at $ok1/$ok2.
You can also test MW before and after r106935 to see if that helps.
(In reply to comment #6) > Can you test a bit of PHP code, e.g.: > ... > And look at $ok1/$ok2. I added following code into FSLockManager.php, and my php-errors.log shows: [21-Dec-2011 18:10:23] $ok1: "1" [21-Dec-2011 18:10:23] $ok2: "" Sorry that I know almost nothing about php... =================================================================== --- FSLockManager.php (revision 106928) +++ FSLockManager.php (working copy) @@ -94,6 +94,15 @@ $this->handles[$key][$type] = $handle; } else { fclose( $handle ); + + $fp1 = fopen( 'D:\\App\\mediawiki\\images\\5\\5d\\redmine_mylyn_03_add_repository.png', 'a+' ); + $ok1 = flock( $fp1, LOCK_SH | LOCK_NB ); + $fp2 = fopen( 'D:\\App\\mediawiki\\images\\5\\5d\\redmine_mylyn_03_add_repository.png', 'a+' ); + $ok2 = flock( $fp2, LOCK_EX | LOCK_NB ); + + error_log('$ok1: "'.$ok1.'"'); + error_log('$ok2: "'.$ok2.'"'); + $status->fatal( 'lockmanager-fail-acquirelock', $key ); } } else {
(In reply to comment #7) > You can also test MW before and after r106935 to see if that helps. I can finally upload the file after updating to r106935. Thanks for your help!!