Repository navigation
buffer: describe what total_limit_size and overflow_action apply to - #732
Merged
Watson1978 merged 2 commits intoNov 30, 2026
Merged
Conversation
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 fluent#163 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
👷 Deploy request for fluentd-docs pending review.Visit the deploys page to approve it
|
Watson1978
requested changes
Nov 29, 2026
Watson1978
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working on this. The main corrections match the code. The stage counts toward total_limit_size, block retries the write, and drop_oldest_chunk only drops queued chunks.
I found two places where the new text is still not accurate:
- Chunks that are being flushed also count toward
total_limit_size(lines 417 and 526 ofconfiguration/buffer-section.md, and line 160 ofoutput/README.md). - With
<label @ERROR>,throw_exceptiondoes not raise the error to the input plugin (lines 527-529).
I left suggestions for both, and two small nits. I checked each case by running Fluentd (master, 1.20.1).
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 <label @error>, throw_exception routes the events to that label instead of raising the error to the input plugin, so mention that. For block, say that the events are not rejected because of the limit rather than that they are not lost, and that the error is raised at shutdown only while the buffer is still full. For drop_oldest_chunk, join the split sentence and describe the recheck of the limit after trying to drop a chunk. Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
Watson1978
approved these changes
Nov 30, 2026
Watson1978
left a comment
Contributor
There was a problem hiding this comment.
Thanks for applying the suggestions. I ran the cases again on Fluentd master (1.20.1), and the new text matches the behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Buffer Section article says that once
total_limit_sizeis reached "all append operations will fail with error (and data will be lost)", and thatoverflow_actionapplies "when its buffer queue is full". Neither matches the code, which is what #163 ran into:Buffer#storable?comparestotal_limit_sizewith the staged and queued sizes together. A chunk being flushed stays in the queued size until it is purged, so staged chunks, queued chunks and chunks being flushed all count.Output#write_guardhandles the resultingBufferOverflowErroraccording tooverflow_action:throw_exceptionraises the error. With<label @ERROR>, the events are routed to that label. Otherwise the error reaches the input plugin that emitted the events, and whether the events are lost depends on that plugin. For example,in_tailkeeps the rejected lines and sends them again later.blockwaits until the buffer can store more data and then retries the write, so the events are not rejected because of the limit. The exception is a shutdown while the buffer is still full, which re-raises the error.drop_oldest_chunkonly drops a chunk in the queue. Staged chunks and chunks being flushed are never dropped. If the total is still at or above the limit afterwards, for example because the queue was empty, the error is raised as withthrow_exception.This PR updates the
total_limit_sizeandoverflow_actiondescriptions inconfiguration/buffer-section.mdto match. It also fixes the first sentence ofoverflow_actioninoutput/README.md, which said "when the queue becomes full" as well. The new text follows the analysis in the issue comments.Fixes #163