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.
Version: 1.22.0
Severity: normal