Skip to content

input_chunk: restrict appending chunks greater than size limit#9995

Open
braydonk wants to merge 2 commits intofluent:masterfrom
braydonk:chunk_size_limit
Open

input_chunk: restrict appending chunks greater than size limit#9995
braydonk wants to merge 2 commits intofluent:masterfrom
braydonk:chunk_size_limit

Conversation

@braydonk
Copy link
Copy Markdown
Contributor

This PR is a second attempt at restricting input chunk sizes by splitting up input buffers in input_log_append based on the chunk max size. It also adds a companion configuration option storage.chunk_max_size to configure the max chunk size.

Detailed information can be found in the companion gist I wrote, which contains explanations of this solution, the other solutions I tried that failed, and testing methodology. https://gist.github.com/braydonk/f32256488e989c4e807b0f9ba69bebbb

Issues: #9374, #1938


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Adds a configuration value that can be used instead of
`FLB_INPUT_CHUNK_FS_MAX_SIZE` for the max size of an input chunk.

Signed-off-by: braydonk <braydonk@google.com>
Perform a check during `input_log_append` that will verify that the
passed buffer does not exceed the chunk max size. If that is the case,
the chunk will be split into multiple sets of data that are as big as
they can be before the chunk size limit to be appended separately.

Signed-off-by: braydonk <braydonk@google.com>
Comment thread src/flb_input_log.c
/* Send the events we have so far. */
ret = flb_input_chunk_append_raw(ins, FLB_INPUT_LOGS, in_records,
tag, tag_len,
out_buf + in_buf_start, in_buf_size);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Egg on my face, I never realized that arithmetic on void pointers is illegal in compilers other than GCC; GCC handles void a special way, making sizeof(void) = 1. I'll need to think of another way to do this to allow for other compilers to work.

@cameronattard
Copy link
Copy Markdown

Would love to see some movement on this!

@braydonk
Copy link
Copy Markdown
Contributor Author

I will likely not get time in the foreseeable future to finish this PR. Anyone is welcome to take it over the finish line.

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions Bot added the Stale label Sep 10, 2025
@pierluigilenoci
Copy link
Copy Markdown
Contributor

Could this be resolved?

@github-actions github-actions Bot removed the Stale label Oct 25, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions Bot added the Stale label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants