From: Christopher Faulet Date: Tue, 9 May 2023 09:31:24 +0000 (+0200) Subject: BUG/MEDIUM: cache: Don't request more room than the max allowed X-Git-Tag: v2.8-dev11~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6f0557deb671f8a4e5228ac7e107916a555c436;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: cache: Don't request more room than the max allowed Since a recent change on the SC API, a producer must specify the amount of free space it needs to progress when it is blocked. But, it must take care to never exceed the maximum size allowed in the buffer. Otherwise, the stream is freezed because it cannot reach the condition to unblock the producer. In this context, there is a bug in the cache applet when it fails to dump a message. It may request more space than allowed. It happens when the cached object is too big. It is a 2.8-specific bug. No backport needed. --- diff --git a/src/cache.c b/src/cache.c index cebd17e3de..8118387c9f 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1513,7 +1513,7 @@ static void http_cache_io_handler(struct appctx *appctx) if (len) { ret = htx_cache_dump_msg(appctx, res_htx, len, HTX_BLK_UNUSED); if (ret < len) { - sc_need_room(sc, len - ret); + sc_need_room(sc, channel_htx_recv_max(res, res_htx) + 1); goto out; } }