Skip to content

Temp file cleanup on process crash, or at least specify temp path #144

@cbecker

Description

@cbecker

I noticed two cases where temp files are created:

  • A %Waffle.File is created with the binary field
  • convert (or another tool) is called to transform the file

In production, this is dangerous: if the process handling the temp files crashes, temp files are not removed and will dangle, potentially occupying significant storage (even filling it if not cleaned up for a long time).

I see two options here, IMO they must be both implemented:

  1. Allow to specify the temp dir for waffle, and use it in Waffle.File.generate_temporary_file
  2. Briefly-like auto temp file deletion

(1) can be used to periodically clean up old files (e.g. > 1 hour)
(2) is the best option, but assumes a %Waffle.File does not cross process boundaries

@achempion I'd like to hear your opinion, maybe there is a better option.
I've seen this be a problem in production and eventually occupy all disk space with old temp files.

EDIT: I wonder if we could do without temp files at all. convert could output/input to/from stdout/stdin, but not sure where else we need explicit files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions