Bug while using "proxy_cache_use_stale updating"

Jérôme Loyet jerome at loyet.net
Fri Aug 28 17:57:04 MSD 2009


Le 28 août 2009 13:59, Jérôme Loyet<jerome at loyet.net> a écrit :
> 2009/8/27 icqheretic <nginx-forum at nginx.us>:
>> Hi Jerome, I may be hitting a similar issue with 0.8.10.
>
> I confirm that the bug is having a similar issue with 0.8.10. I've
> just tested it.
>
> By the way, the bug does not appear if I add 404 page to
> proxy_cache_valid directive:
>
>  proxy_cache_valid 200 302 404 30s;
>
> An other solution is to remove the "updating" option for the
> "proxy_cache_use_stale" directive.
>
> I'm looking into the code to try to find a solution.

After several trials, I made a patch. This seems to correct the issue.
Hope no other bugs are implied buy this diff:

--- src/http/ngx_http_upstream.c.orig   2009-08-23 18:10:39.000000000 +0200
+++ src/http/ngx_http_upstream.c        2009-08-28 15:54:43.000000000 +0200
@@ -2574,6 +2574,8 @@
             } else if (p->upstream_error) {
                 ngx_http_file_cache_free(r, u->pipe->temp_file);
             }
+        } else {
+            ngx_http_file_cache_free(r, u->pipe->temp_file);
         }

 #endif





More information about the nginx mailing list