Skip to content

Tempfile no longer unlinks created files upon garbage collection #1133

@svetlins

Description

@svetlins

Hello,

We are having a problem since upgrading to jruby 1.7.4 in production - files created by Tempfile don't get deleted when the instances of Tempfile are garbage collected, only when the jruby process exits.

I've managed to track down the change of behaviour to the commit 607c6d5 .

There is a test for exactly this behaviour in test/test_tempfile_cleanup.rb which dutifully breaks at exactly this commit (running with jruby test/test_tempfile_cleanup.rb)

We are seeing a problem with this because we are using the paperclip gem which unfortunately creates a lot of Tempfiles without taking care of closing and unlinking them explicitly. I guess there are/will be a lot of people with the same problem as paperclip is a quite popular gem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions