BUG/MEDIUM: cache/htx: Respect the reserve when cached objects are served

It is only true for HTX streams. The legacy code relies on ci_putblk() which is
already aware of the reserve. It is mandatory to not fill the reserve to let
other filters analysing data. It is especially true for the compression
filter. It needs at least 20 bytes of free space, plus at most 5 bytes per 32kB
block. So if the cache fully fills the channel's buffer, the compression will
not have enough space to do its job and it will block the data forwarding,
waiting for more free space. But if the buffer fully filled with input data (ie
no outgoing data), the stream will be frozen infinitely.

This patch must be backported to 1.9. It depends on the following patches:

  * BUG/MEDIUM: cache/htx: Respect the reserve when cached objects are served
    from the cache
  * MINOR: channel/htx: Add HTX version for some helper functions
This commit is contained in:
Christopher Faulet 2019-01-07 14:07:29 +01:00 committed by Willy Tarreau
parent 5811db0043
commit cc156623b2
1 changed files with 1 additions and 1 deletions

View File

@ -900,7 +900,7 @@ static size_t htx_cache_dump_data(struct appctx *appctx, struct htx *htx,
struct cache_flt_conf *cconf = appctx->rule->arg.act.p[0];
struct shared_context *shctx = shctx_ptr(cconf->c.cache);
struct shared_block *shblk = appctx->ctx.cache.next;
uint32_t max = htx_free_data_space(htx);
uint32_t max = channel_htx_recv_max(si_ic(appctx->owner), htx);
unsigned int offset;
size_t total = 0;