Last modified: 2013-11-09 09:26:32 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 T51391, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49391 - FSFileBackend doPrepareInternal() should recover from mkdir failure when directory exists (race)
FSFileBackend doPrepareInternal() should recover from mkdir failure when dire...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-10 16:43 UTC by Ariel T. Glenn
Modified: 2013-11-09 09:26 UTC (History)
4 users (show)

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


Attachments

Description Ariel T. Glenn 2013-06-10 16:43:34 UTC
Browsers doing multiple http requests at once for items linked to (thumbs) in a file description page are going to set off the race condition from time to time in FSFBackend:

if ( !wfMkdirParents( $dir ) ) { // make directory and its parents
     $status->fatal( 'directorycreateerror', $params['dir'] ); // fails on races

Why not check if the error was 'File exists' and proceed in that case?  The debug log entry looks like this:
[FSFileBackend] mkdir() [<a href='function.mkdir'>function.mkdir</a>]: File exists
If the status object doesn't have a good representation of the type of error condition, you could always double check if the dir is suddenly there before giving up.
Comment 1 Elliott Eggleston 2013-09-12 02:04:06 UTC
Sounds like a good idea, but maybe wfMkdirParents should be the one to check again for the directory's existence if mkdir fails, since it initially checks and returns true if the dir already exists.
Comment 2 Elliott Eggleston 2013-09-12 22:58:28 UTC
Just submitted https://gerrit.wikimedia.org/r/84100 to have wfMkdirParents return true if another request causes the directory to be created.  Reviewers are most welcome!
Comment 3 Gerrit Notification Bot 2013-09-12 23:43:47 UTC
Change 84100 had a related patch set uploaded by Parent5446:
wfMkdirParents: recover from mkdir race condition

https://gerrit.wikimedia.org/r/84100
Comment 4 Gerrit Notification Bot 2013-09-12 23:48:38 UTC
Change 84100 merged by jenkins-bot:
wfMkdirParents: recover from mkdir race condition

https://gerrit.wikimedia.org/r/84100
Comment 5 Umherirrender 2013-11-09 09:26:32 UTC
Was successfully merged

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


Navigation
Links