Currently if two files are uploaded at the same time, they could both have the same name. This would result in an error, though exactly what the error behaviour would be is undetermined.
We should add a read lock in File::onBeforeWrite() to avoid other processes creating files with the same name before this process has a chance to persist in the database.
Description
Currently if two files are uploaded at the same time, they could both have the same name. This would result in an error, though exactly what the error behaviour would be is undetermined.
We should add a read lock in
File::onBeforeWrite()
to avoid other processes creating files with the same name before this process has a chance to persist in the database.See: https://github.com/silverstripe/silverstripe-assets/blob/27000f18654ce66e6e92e40bb220121b8d750855/src/File.php#L714