Welcome! Log In Create A New Profile

Advanced

Re: nginx cache exceeded, cache manager busy

zls
June 25, 2011 10:57AM
We've found the problem and sent email to "igor@sysoev.ru", but got no answers.

It's caused in ngx_http_upstream_process_header. If r->cache->header_start is bigger than u->conf->buffer_size, u->buffer.last will be bigger than u->buffer.end, and the response header will be written to invalid memory for this buffer. But the written memory may be valid for this process, so core dump usually happens some time later, and backstrace shows somewhere else.

a patch based on nginx-1.0.4:

diff -ruNp nginx-1.0.4/src/http/ngx_http_upstream.c nginx-1.0.4_zls/src/http/ngx_http_upstream.c
--- nginx-1.0.4/src/http/ngx_http_upstream.c 2011-06-01 16:02:34.000000000 +0800
+++ nginx-1.0.4_zls/src/http/ngx_http_upstream.c 2011-06-22 00:41:32.282201935 +0800
@@ -661,6 +661,16 @@ ngx_http_upstream_cache(ngx_http_request

ngx_http_file_cache_create_key(r);

+ if (r->cache->header_start >= u->conf->buffer_size){
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "cache disabled because of too big cache_key (%uz vs %uz)",
+ r->cache->header_start, u->conf->buffer_size
+ );
+
+ r->cache = NULL;
+ return NGX_DECLINED;
+ }
+
switch (ngx_http_test_predicates(r, u->conf->cache_bypass)) {

case NGX_ERROR:
Subject Author Posted

nginx cache exceeded, cache manager busy

wzpzning March 15, 2011 03:32AM

Re: nginx cache exceeded, cache manager busy

nettie March 15, 2011 05:36AM

Re: nginx cache exceeded, cache manager busy

zls June 07, 2011 10:37PM

Re: nginx cache exceeded, cache manager busy

Tony June 07, 2011 06:14AM

Re: nginx cache exceeded, cache manager busy

Igor Sysoev June 07, 2011 06:16AM

Re: nginx cache exceeded, cache manager busy

Tony June 07, 2011 06:26AM

Re: nginx cache exceeded, cache manager busy

Igor Sysoev June 08, 2011 09:30AM

Re: nginx cache exceeded, cache manager busy

zls June 10, 2011 04:18AM

Re: nginx cache exceeded, cache manager busy

zls June 12, 2011 10:34AM

Re: nginx cache exceeded, cache manager busy

zls June 25, 2011 10:57AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 85
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 254 on July 05, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready