]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cache: Add entry to the tree as soon as possible
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 25 Nov 2020 09:09:43 +0000 (10:09 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 2 Dec 2020 15:38:42 +0000 (16:38 +0100)
commit3243447f831d1d2a32c7a1ed6f90d40b42b6cd5f
tree566d3a7f8a31a4803ea762a6c4ea6e057a9d6b2e
parent8bb72aa82fd68822fc116f58a062e97c924b4fe5
MINOR: cache: Add entry to the tree as soon as possible

When many concurrent requests targeting the same resource were seen, the
cache could sometimes be filled by too many partial responses resulting
in the impossibility to cache a single one of them. This happened
because the actual tree insertion happened only after all the payload of
every response was seen. So until then, every response was added to the
cache because none of the streams knew that a similar request/response
was already being treated.
This patch consists in adding the cache_entry as soon as possible in the
tree (right after the first packet) so that the other responses do not
get cached as well (if they have the same primary key).
A "complete" flag is also added to the cache_entry so that we know if
all the payload is already stored in the entry or if it is still being
processed.
src/cache.c