Last modified: 2012-05-03 02:42:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35294, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33294 - Could not acquire lock when uploading a new version of an existing file
Could not acquire lock when uploading a new version of an existing file
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.20.x
PC Windows Server 2003
: Normal normal (vote)
: 1.19.0 release
Assigned To: Nobody - You can work on this!
: platformeng
Depends on:
Blocks: 31217
  Show dependency treegraph
 
Reported: 2011-12-21 05:51 UTC by Pei-Tang Huang
Modified: 2012-05-03 02:42 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Pei-Tang Huang 2011-12-21 05:51:20 UTC
When uploading a new version of an existing file.
I always got the following message:

    Could not acquire lock for key "est5rsvfknamj8y9bqldhv8tszzpfqe".
Comment 1 Mark A. Hershberger 2011-12-21 06:37:31 UTC
tagging for platformeng to see if anyone can repro a non-windows platform.
Comment 2 Bawolff (Brian Wolff) 2011-12-21 07:29:48 UTC
[mid-air collision] cc'ing aaron since this is presumably file backend related (they did say 1.19-svn in version field).
Comment 3 Pei-Tang Huang 2011-12-21 08:57:56 UTC
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!
Comment 4 Aaron Schulz 2011-12-21 09:18:47 UTC
(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?
Comment 5 Pei-Tang Huang 2011-12-21 09:29:05 UTC
(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.
Comment 6 Aaron Schulz 2011-12-21 09:37:04 UTC
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.
Comment 7 Aaron Schulz 2011-12-21 10:14:24 UTC
You can also test MW before and after r106935 to see if that helps.
Comment 8 Pei-Tang Huang 2011-12-21 10:20:42 UTC
(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 {
Comment 9 Pei-Tang Huang 2011-12-21 10:21:40 UTC
(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!!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links