Add FileStore.purge_tmp() method

Bug #1014214 reported by Jason Gerard DeRose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FileStore
Fix Released
High
Jason Gerard DeRose

Bug Description

To add a file to a FileStore, it's first copied to a temporary location in .dmedia/tmp/. After the content-hash is computed, the file is moved to its canonical location in .dmedia/files/.

Because os.rename() is atomic on POSIX systems, files are always in a well-defined state as either being temporary or being stored, with no fuzzy middle area. Because of this, we're treating anything in .dmedia/tmp/ as fair game for deletion.

There are a number of ways in which you might get stale temporary files: you abort an import, an error occurs during an import, a render fails, etc. So it's a good idea for us to periodically purge stale temporary files so they don't build up over time. Dmedia will do this when a FileStore is first connected.

Related branches

Changed in filestore:
status: In Progress → Fix Committed
Changed in filestore:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.