]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: pools: always flush pools about to be destroyed
authorWilly Tarreau <w@1wt.eu>
Wed, 9 Feb 2022 15:19:24 +0000 (16:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Feb 2022 19:10:43 +0000 (20:10 +0100)
commitc895c441c7579db652e4ed976c14c2f5b2de0c0e
treeb76f29ea3bbdd5a99ef8921b7ddf88523088680d
parentb5ba09ed589c4e15f2b60c59f55da84e06689631
BUG/MINOR: pools: always flush pools about to be destroyed

When destroying a pool (e.g. at exit or when resizing buffers), it's
important to try to free all their local objects otherwise we can leave
some in the cache. This is particularly visible when changing "bufsize",
because "show pools" will then show two "trash" pools, one of which
contains a single object in cache (which is fortunately not reachable).
In all cases this happens while single-threaded so that's easy to do,
we just have to do it on the current thread.

The easiest way to do this is to pass an extra argument to function
pool_evict_from_local_cache() to force a full flush instead of a
partial one.

This can probably be backported to about all branches where this
applies, but at least 2.4 needs it.
include/haproxy/pool.h
src/pool.c