r102502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102501‎ | r102502 | r102503 >
Date:09:59, 9 November 2011
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
More fixes for r102482: the $wouldBlock check doesn't appear to work, also don't use a lock timeout so long that the client times out.
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/ExtensionDistributor/svn-invoker.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ExtensionDistributor/svn-invoker.php
@@ -65,16 +65,12 @@
6666 svnError( 'extdist-remote-error', "Unable to open lock file." );
6767 return;
6868 }
69 - $timeout = 20;
 69+ $timeout = 3;
7070 for ( $i = 0; $i < $timeout; $i++ ) {
7171 $wouldBlock = false;
7272 if ( flock( $lockFile, LOCK_EX | LOCK_NB ) ) {
7373 break;
7474 }
75 - if ( !$wouldBlock ) {
76 - svnError( 'extdist-remote-error', "Error attempting to obtain lock." );
77 - return;
78 - }
7975 sleep( 1 );
8076 }
8177 if ( $i == $timeout ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r102503Merged r102502 from 1.18wmf1tstarling10:01, 9 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102482Added an external locking layer around Subversion access to the repository. I...tstarling02:40, 9 November 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   22:59, 4 January 2012

I didn't see $wouldBlock getting passed in to flock()?

#Comment by Tim Starling (talk | contribs)   19:05, 21 January 2012

Yes, I suppose passing $wouldBlock to flock() would help. But I'm not really interested in maintaining this since it will have to be done differently for git.

Status & tagging log