Opened 11 years ago

Last modified 9 years ago

#612 new defect

MediaFile deletion bails on with missing files on cloudfiles

Reported by: spaetz Owned by:
Priority: major Milestone:
Component: programming Keywords:
Cc: Parent Tickets:


MediaEntry.delete does this:

        except OSError, error:

joar says that the cloudfiles plugin raises a different exception when files are missing (somthing that is an IOError subclass).

So the very least we need to do here, is to also catch IOError and make them non-fatal.

Even better, if we could make the file deletion be celery tasks. In this case we would get automatic retries in case of failures (with separate-process celery) even after some waiting time.

Change History (1)

comment:1 by Loic Dachary, 9 years ago

It looks like a way to fix this would be for mediagoblin/storage/ to remap the cloudfile error condition indicating that a file does not exist into OSError for the benefit of MediaEntry.delete. For reference, here is the current code that would need to be patched:

    def delete_file(self, filepath):
        # TODO: Also delete unused directories if empty (safely, with
        # checks to avoid race conditions).
        except cloudfiles.container.ResponseError:
Last edited 9 years ago by Loic Dachary (previous) (diff)
Note: See TracTickets for help on using tickets.