httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f_los_ch <f_los...@yahoo.com>
Subject Re: corrupt brigades when using mod_cache in reverse proxy
Date Sat, 19 Nov 2011 13:56:31 GMT
Hello,

Thanks for the reply and your patch - it worked!

I could not longer reproduce diffs for cached/uncached files. The log
with dumped buckets according to my previous patch is again available
at: http://paste2.org/p/1785342

Now, when the location is spotted, maybe I can also try to isolate the
bug even more via further debugging for developing some production-use
patch. In the hope that really the bug was in there and the continuous
flushing did not masquerade the underlying issue..?

But that it is working for now is a real relief.

Thanks again & kind regards:
Florian


Am Samstag, den 19.11.2011, 03:09 +0200 schrieb Graham Leggett: 
> On 18 Nov 2011, at 9:50 PM, f_los_ch wrote:
> 
> > When enabling mod_cache in my reverse-proxy scenario, the first file
> > with a filesize above some threshold gets delivered corrupted,
> > subsequent requests served from cache are fine.
> 
> Can you confirm if the following patch makes any difference for you? I  
> suspect the disk cache is finding a way to leave without passing all  
> the saved buckets to out first.
> 
> Index: modules/cache/mod_cache_disk.c
> ===================================================================
> --- modules/cache/mod_cache_disk.c	(revision 1203646)
> +++ modules/cache/mod_cache_disk.c	(working copy)
> @@ -1098,7 +1098,7 @@
>           /* are we done completely? if so, pass any trailing buckets  
> right through */
>           if (dobj->done || !dobj->data.pool) {
>               APR_BUCKET_REMOVE(e);
> -            APR_BRIGADE_INSERT_TAIL(out, e);
> +            APR_BRIGADE_INSERT_TAIL(dobj->bb, e);
>               continue;
>           }
> 
> @@ -1107,16 +1107,14 @@
>               seen_eos = 1;
>               dobj->done = 1;
>               APR_BUCKET_REMOVE(e);
> -            APR_BRIGADE_CONCAT(out, dobj->bb);
> -            APR_BRIGADE_INSERT_TAIL(out, e);
> +            APR_BRIGADE_INSERT_TAIL(dobj->bb, e);
>               break;
>           }
> 
>           /* honour flush buckets, we'll get called again */
>           if (APR_BUCKET_IS_FLUSH(e)) {
>               APR_BUCKET_REMOVE(e);
> -            APR_BRIGADE_CONCAT(out, dobj->bb);
> -            APR_BRIGADE_INSERT_TAIL(out, e);
> +            APR_BRIGADE_INSERT_TAIL(dobj->bb, e);
>               break;
>           }
> 
> @@ -1203,17 +1201,18 @@
>           dobj->offset -= length;
>           if (dobj->offset <= 0) {
>               dobj->offset = 0;
> -            APR_BRIGADE_CONCAT(out, dobj->bb);
>               break;
>           }
>           if ((dconf->readtime && apr_time_now() > dobj->timeout)) {
>               dobj->timeout = 0;
> -            APR_BRIGADE_CONCAT(out, dobj->bb);
>               break;
>           }
> 
>       }
> 
> +    /* make sure we sweep all saved buckets to the out brigade */
> +    APR_BRIGADE_CONCAT(out, dobj->bb);
> +
>       /* Was this the final bucket? If yes, close the temp file and  
> perform
>        * sanity checks.
>        */
> 
> Regards,
> Graham
> --
> 



Mime
View raw message