On Sat, 28 Apr 2001, Justin Erenkrantz wrote: > Aren't some of the resource leakages in httpd coming from the fact > that the buckets aren't cleaning up after themselves? They do > reference counting, but my guess is that they should close their > private structures as well when they are no longer around.
There's a sideband discussion on this. Ryan's strongly opposed to closing the files/mmaps when the last bucket goes away, as I believe he pointed out in another response to this message, because it incurs an extra syscall during the request proper. I've argued against that to little/no avail. > mod_core opens a file and gives it apr_bucket_file_create. After > that point, shouldn't the bucket "own" the fd and close it when > it is done? That's what Greg and I have said. But we just can't convince Ryan. And admittedly he has a good reason... it's a toss-up. There are pros and cons either way. 1.3 did it by letting the pool do the work, so I guess we should too. > I'm going to implement this in my local tree and see if it blows > up things spectacularly. -- justin There are issues to be aware of if you're going to try it. For example, you can't count on an MMAP surviving if its underlying file gets closed. Assuming Ryan doesn't object too strongly, I plan on changing the file buckets very soon to be more like pool buckets, in that when one file bucket gets MMAPed, all of its siblings get lazily morphed to MMAP-type as well. The main issue you need to watch out for is in which cases you can safely close the file--that's tough to do with the current code but should be easy with the change I propose. Try it on MMAP's if you want... that should be safe, or at least safer than closing the files. PS: Another reason not to close the files right now is that it would break the module that caches FD's. I've got a proposed fix for that as well. --Cliff -------------------------------------------------------------- Cliff Woolley [EMAIL PROTECTED] Charlottesville, VA