From: Maxime Henrion Date: Fri, 10 Jul 2026 00:46:42 +0000 (-0400) Subject: BUG/MEDIUM: cache: reattach the row when a secondary entry is incomplete X-Git-Url: http://git.kaiwu.me/http/doc/static/gitweb.js?a=commitdiff_plain;h=dc50a814c785430680a07bd6689ce61b1f4065d6;p=haproxy.git BUG/MEDIUM: cache: reattach the row when a secondary entry is incomplete In http_action_req_cache_use() with Vary, the row of the secondary entry matching the request is detached from the avail list for reading. Since get_secondary_entry() only rejects expired entries, that secondary may be incomplete (still being written by another stream), and in that case the request was forwarded without reattaching the row, leaking its blocks out of the avail list (refcount and nbav never restored). Over a Vary workload this eventually prevents the cache from reserving any row. Reattach the row before returning, as the other paths that give up on the cache entry do. Present since the Vary support was added in 2.4 (1785f3dd9); to be backported as far as 2.6. --- diff --git a/src/cache.c b/src/cache.c index 79cfa6357..c995890a4 100644 --- a/src/cache.c +++ b/src/cache.c @@ -2231,6 +2231,9 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p return ACT_RET_CONT; } else if (!res->complete) { release_entry(cache_tree, res, 1); + shctx_wrlock(shctx); + shctx_row_reattach(shctx, entry_block); + shctx_wrunlock(shctx); return ACT_RET_CONT; }