Forum OpenACS Q&A: Content Repository file storage items not deleted on aborted transactions

Summary:
If a cr_content_import call is made inside a db_transaction aand the transaction is later rolled back, the file contents copied into the cr_fs_root remain.

Proposed solution:
Write a cr "log file" that records file imports and periodically call a scheduled procedure that "commits" items out of that log file, or detects that the import was never completed and instead cleans up the file. This procedure would be analoogous to a fsck after a crash.

I believe there is a sweeper proc that deletes items does not exists on the db on the cr_fs_root. Or was it a sweeper proc that deletes items that are marked deleted on the db. I forgot already, its been a while since I looked at it. I am not sure if it handles rolled back items. You may want to check that out and modify that.
The scheduled proc only deletes files that are marked as deleted. If the transaction is aborted and rolled back, I don't believe any entries would be made since the items will never have "existed" as far as the scheduled proc is concerned.