Last modified: 2013-11-09 09:26:32 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.
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.
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!
Change 84100 had a related patch set uploaded by Parent5446: wfMkdirParents: recover from mkdir race condition https://gerrit.wikimedia.org/r/84100
Change 84100 merged by jenkins-bot: wfMkdirParents: recover from mkdir race condition https://gerrit.wikimedia.org/r/84100
Was successfully merged