On 8 Mar 2010, at 11:26, Hongli Lai wrote: > On Mar 8, 12:53 am, Eric Wong wrote: >> Always? Why? > > To simply our code. Phusion Passenger forks-without-exec worker > processes from a parent. It does this on multiple levels. If I don't > call exit! then a SystemExit exception will propagate through the call > stack and I'd have to modify all the 'ensure' blocks in the parent to > take into account they're now being executed in a child process. It's > definitely possible to get rid of the exit! but it makes our code more > complicated. I can see how that would be painful, totally. >> Doesn't Passenger have the luxury of only supporting sane platforms >> that let you unlink Tempfiles and continue to use them? > > Yes but the Tempfile is created by Rack and on the Phusion Passenger > level we have no control over those tempfiles. Even if Rack > immediately unlinks those tempfiles, the actual disk space isn't > released until the file handles are closed. I believe Rack currently > does not even call #close on the Tempfiles. Correct. Some servers do, for example, in thin: http://github.com/macournoyer/thin/blob/master/lib/thin/request.rb#L143 > I think software should > do the right thing even in the face of people who don't know how to > use lsof. Just to be clear, I don't disagree at all that this needs to be fixed. I think handlers/servers should close any tempfiles they create, and the requirement for middleware should be the same.