You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Eric Covener <co...@gmail.com> on 2013/09/13 03:00:23 UTC

contrast cache_remove_url() and cache_remove_entity()?

Can anyone contrast these two and/or comment the callback structure in
mod_cache.h?

In 2.4, It looks like mod_disk_cache's remove_url() callback does not
close open file descriptors.  I think those are normally closed by
some indirect aspect of the file buckets' pool going out of scope --
but they need to be closed prior to the unlink() on windows.

-- 
Eric Covener
covener@gmail.com

Re: contrast cache_remove_url() and cache_remove_entity()?

Posted by Eric Covener <co...@gmail.com>.
On Fri, Sep 13, 2013 at 12:32 PM, Mike Rumph <mi...@oracle.com> wrote:
> Hello Eric,
>
> Do you mean cache_remove_url() and cache_create_entity()?
>

There is a remove_entity() and a remove_url(). Presumably the latter
removes all possible cached entities for the given URL?

> By "comment the callback structure" are you asking for documentation on how
> these functions are called?

Yes, some doc would be nice as if they were normal API.

typedef struct {
    int (*remove_entity) (cache_handle_t *h);
    apr_status_t (*store_headers)(cache_handle_t *h, request_rec *r,
cache_info *i);
    apr_status_t (*store_body)(cache_handle_t *h, request_rec *r,
apr_bucket_brigade *in,
                           apr_bucket_brigade *out);
    apr_status_t (*recall_headers) (cache_handle_t *h, request_rec *r);
    apr_status_t (*recall_body) (cache_handle_t *h, apr_pool_t *p,
apr_bucket_brigade *bb);
    int (*create_entity) (cache_handle_t *h, request_rec *r,
                           const char *urlkey, apr_off_t len,
apr_bucket_brigade *bb);
    int (*open_entity) (cache_handle_t *h, request_rec *r,
                           const char *urlkey);
    int (*remove_url) (cache_handle_t *h, request_rec *r);
    apr_status_t (*commit_entity)(cache_handle_t *h, request_rec *r);
    apr_status_t (*invalidate_entity)(cache_handle_t *h, request_rec *r);
} cache_provider;

Re: contrast cache_remove_url() and cache_remove_entity()?

Posted by Mike Rumph <mi...@oracle.com>.
Hello Eric,

Do you mean cache_remove_url() and cache_create_entity()?

I notice the following httpd version differences that you probably 
already know.
I see that these functions are declared in mod_cache.h only in httpd 2.2.
In 2.4 and trunk these are declared in cache_storage.h.
And mod_disk_cache.* in 2.2 is renamed to mod_cache_disk.* in 2.4 and trunk.

By "comment the callback structure" are you asking for documentation on 
how these functions are called?

Thanks,

Mike Rumph

On 9/12/2013 6:00 PM, Eric Covener wrote:
> Can anyone contrast these two and/or comment the callback structure in
> mod_cache.h?
>
> In 2.4, It looks like mod_disk_cache's remove_url() callback does not
> close open file descriptors.  I think those are normally closed by
> some indirect aspect of the file buckets' pool going out of scope --
> but they need to be closed prior to the unlink() on windows.
>


Re: contrast cache_remove_url() and cache_remove_entity()?

Posted by Graham Leggett <mi...@sharp.fm>.
On 13 Sep 2013, at 3:00 AM, Eric Covener <co...@gmail.com> wrote:

> Can anyone contrast these two and/or comment the callback structure in
> mod_cache.h?
> 
> In 2.4, It looks like mod_disk_cache's remove_url() callback does not
> close open file descriptors.  I think those are normally closed by
> some indirect aspect of the file buckets' pool going out of scope --
> but they need to be closed prior to the unlink() on windows.

To be as performant as possible the cache should release anything it holds open as soon as possible, so if it is not explicitly closing these open file descriptors ASAP we should be.

Ideally this should have used a subpool, however I left performance improvements to after we'd achieved full RFC compliance from the Co-Advisor test suite (which we now have in trunk).

Regards,
Graham
--