From 1f2da9da6b16f1b9d18abd3c2b58b0d1ddb8b69a Mon Sep 17 00:00:00 2001 From: NopeCharon <115794254+NopeCharon@users.noreply.github.com> Date: Sat, 28 Nov 2026 05:08:22 +0000 Subject: [PATCH 1/2] buffer: describe what total_limit_size and overflow_action apply to The description of total_limit_size said that all append operations fail and data is lost once the limit is reached, and the description of overflow_action said it applies when the buffer queue is full. Neither is accurate. Buffer#storable? compares total_limit_size with the size of the staged and queued chunks together, and Output#write_guard handles the resulting BufferOverflowError according to overflow_action: * throw_exception raises the error to the input plugin, which decides whether the events are lost. * block waits until the buffer can store more data and retries the write, so the events are not lost, unless Fluentd is shut down while waiting. * drop_oldest_chunk can only drop a chunk in the queue. If there is none, or dropping one does not free enough space, the error is raised as with throw_exception. Update both descriptions in the Buffer Section article, and the description of overflow_action in the Output Plugins article. Fixes #163 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com> --- configuration/buffer-section.md | 16 +++++++++------- output/README.md | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/configuration/buffer-section.md b/configuration/buffer-section.md index 96b07be9..004d9f45 100644 --- a/configuration/buffer-section.md +++ b/configuration/buffer-section.md @@ -414,9 +414,7 @@ Following are the configuration parameters for buffer plugin and its chunks: * `total_limit_size` \[size\] * Default: 512MB \(memory\) / 64GB \(file\) * The size limitation of this buffer plugin instance - * Once the total size of stored buffer reaches this threshold, all append - - operations will fail with error \(and data will be lost\) + * The limit applies to the staged and queued chunks together. Once their total size reaches this threshold, the buffer does not accept new events, and what happens to them depends on `overflow_action` * `queue_limit_length` \[integer\] * Default: `nil` * The queue length limitation of this buffer plugin instance @@ -525,20 +523,24 @@ Following are the flushing parameters for chunks to optimize performance \(laten operation has failed * `overflow_action` \[enum: `throw_exception`/`block`/`drop_oldest_chunk`\] * Default: `throw_exception` - * How does output plugin behave when its buffer queue is full? - * `throw_exception`: raises an exception to show the error in log + * How does output plugin behave when the total size of the staged and queued chunks reaches `total_limit_size`? + * `throw_exception`: raises `BufferOverflowError` to the input plugin that emitted the events, and the events are not written to the buffer. + + Whether they are lost depends on the input plugin. See [Output Plugins - overflow\_action](../output/README.md#overflowaction). * `block`: wait until buffer can store more data. - After buffer is ready for storing more data, writing buffer is retried. + After buffer is ready for storing more data, writing buffer is retried, so the events are not lost. If Fluentd is shut down while waiting, it stops waiting and raises `BufferOverflowError`. Because of such behavior, `block` is suitable for processing batch execution, so do not use for improving processing throughput or performance. - * `drop_oldest_chunk`: drops/purges the oldest chunk to accept newly + * `drop_oldest_chunk`: drops/purges the oldest chunk in the queue to accept newly incoming chunk + Staged chunks and chunks being flushed are not dropped. If there is no chunk in the queue, or dropping the oldest one does not free enough space, the events are rejected in the same way as `throw_exception`. + ### Retries Parameters * `retry_timeout` \[time\] diff --git a/output/README.md b/output/README.md index 7ea91879..a3ae0cf6 100644 --- a/output/README.md +++ b/output/README.md @@ -157,7 +157,7 @@ If chunk flush takes longer time than this threshold, fluentd logs warning messa #### `overflow_action` -Controls the buffer behavior when the queue becomes full. +Controls the buffer behavior when the total size of the staged and queued chunks reaches [`total_limit_size`](../configuration/buffer-section.md#buffering-parameters). The limit covers the stage as well as the queue, so it can be reached even when only a few chunks are queued. Supported modes: From 932efb30b8a345290ea1d990b0167208857cb077 Mon Sep 17 00:00:00 2001 From: NopeCharon <115794254+NopeCharon@users.noreply.github.com> Date: Sun, 29 Nov 2026 10:23:18 +0530 Subject: [PATCH 2/2] buffer: count flushing chunks and @ERROR in overflow docs Chunks that are being flushed stay in the queued size until they are purged, so they count toward total_limit_size as well. The limit is also checked only once before each write, so one write can go beyond it. Describe both, and say "all chunks in the buffer" wherever the text said "the staged and queued chunks". With