-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with TempFiles #43
Comments
Are you sure they're not cleaned up? |
The most bizarre things is the problem only appears if i use passenger. In my local system it's doesn't happen. |
I saw in Ruby doc when we call close methods, the ruby doesn't unlink this file, he will wait for finalized. Possibly this may be the root cause of the problem. |
I'll close this if that's ok - I don't think there's an issue here - let me know if otherwise |
Hi, I had this issue too. The problem can be solved if you unlink the Tempfile when you close it. Tempfiles accept a flag to do this on close (true/false). I had to put this on my app to avoid my /tmp directory to explode with non closed files:
That ensures the actual file on the file system is unlinked as soon as possible. |
Hello, We've been having this issue too. We tracked a problem with apps on heroku crashing thanks to this bug report. Dragonfly was filling up the tmp folder to Heroku's limit. Emmanuel's patch has fixed the problem for us. Cheers |
Hi thanks for the patch - I've added this (or something equivalent) in the new version 0.9.3 3b7578e Bear in mind though, that this only cleans up the tempfile that gets finally served (it works because Rack handlers have a line "body.close if body.respond_to?(:close)"). If you have a chain of processing (e.g. image.thumb('400x400').gif), then any intermediate tempfiles created will still be cleaned up later by the garbage collector. It would not be right to unlink these ones straight away because you haven't necessarily finished with them yet. If it's still a problem let me know and maybe I'll have to put in some way of keeping track of all the created tempfiles then unlinking before serving. cheers |
txs. My patch seemed to fix things "for a while". Soon, tmp files started to appear anyway, which I found strange. I'll try your version seems you seem to be doing more than just unlinking on close. Will let you known if I'm still having the issue. |
my version doesn't really do much more than that (I just added tests and dealt with a couple of edge cases), so you will probably find the same. |
ok that would be awesome. |
OK tempfiles are cleaned up immediately now (version 0.9.4) for GET requests to Dragonfly. note that HEAD requests to Dragonfly and other uses (e.g. calling image.thumb('50x50').data) still rely on garbage collection for cleaning up, but you can manually call Job#close if you need to (though you shouldn't need to!) Please let me know if it works/doesn't work! |
Dragonfly does not delete the files it created in tmp dir. All time, when i fetch some file, it create one tempfile (dragonfly_2010....). No one clean up this files after Dragonfly finish.
Is there some config options to do this? Can i say to no save TempObject?
The text was updated successfully, but these errors were encountered: