]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: cache: reattach the row when a secondary entry is incomplete
authorMaxime Henrion <mhenrion@haproxy.com>
Fri, 10 Jul 2026 00:46:42 +0000 (20:46 -0400)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Jul 2026 14:42:35 +0000 (16:42 +0200)
commitdc50a814c785430680a07bd6689ce61b1f4065d6
tree9a203c1fd9ee876479eeae7bf7fcb014fd22b266
parent912b82d0788554f5856474fc2bcf0f6e588b6cb7
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.
src/cache.c