[wp-trac] [WordPress Trac] #20057: Media upload for multi-webserver setups introduces a nasty race condition that could corrupt uploaded files

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 17 06:16:04 UTC 2012


#20057: Media upload for multi-webserver setups introduces a nasty race condition
that could corrupt uploaded files
--------------------------+------------------------------
 Reporter:  archon810     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  3.3.1
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by dd32):

 I'm not sure checking the database for the existing files is more
 efficient than simply checking that the file exists on disk.

 There's a filter on the unique filename handler (wp_unique_filename() in
 wp-admin/includes/file.php from memory) which would allow you to check the
 database for filename collisions (the filepath should be stored as a meta
 field for each attachment).

 I'm not sure that it's something that is absolutely required for core
 itself, simply due to the unique nature of your setup (Not many others
 would expect a 404 failover, infact, most doing your style HA setup, would
 have static files served from a separate server to limit the load on the
 PHP servers, or utilise a shared network filestore).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20057#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list