httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <>
Subject Re: [PATCH] mod_disk_cache deterministic tempfiles
Date Wed, 17 Aug 2005 20:29:05 GMT
On Wed, Aug 17, 2005 at 04:13:37PM -0400, Brian Akins wrote:
> Graham Leggett wrote:
>  The disk cache might be a
> >bit more involved, but the idea would be the same.
> Only way I can think of this is to keep trying to seek until file gets 
> renamed.  Maybe not very efficient.

Why bother renaming the file for such an implementation? If a
half-cached file can be served from, and this handled properly, the
rename would no longer make any sense :)

For a disk cache it would be tricky to discern between a cached file
that is half there due to a sudden httpd exit, and a cached file that is
half there because a proxy or CGI backend is blocking.

> Or maybe a hash/queue/something that kept track of "in-flight" objects. 
>  But, this would be per process, unless you did it in dbm or something.

One solution that avoids that may be to create random uuid at httpd
start time, and store that in every cache object. That way the caching
layer can determine if the half-cached file on disk belongs to a
"current" instance of httpd - and we assume it's in-flight - or if it
belongs to a previous instance of httpd, and we assume it's leftover
from a sudden death.

Colm MacCárthaigh                        Public Key:

View raw message