-
Notifications
You must be signed in to change notification settings - Fork 1.9k
input_chunk: configuration option for maximum chunk size #11373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
input_chunk: configuration option for maximum chunk size #11373
Conversation
Added configuration parameter for 'service' block to specify maximum chunk size for the 'input_chunk' module. Signed-off-by: Castor Sky <[email protected]>
Added new function 'flb_input_chunk_get_max_size' that retrieves value of the 'storage.max_chunk_size' parameter from the fluent-bit configuration or sets default value of FLB_INPUT_CHUNK_FS_MAX_SIZE (when user have not set parameter or there is any problem in parsing). Function is exposed to other modules and can be used anywhere to get 'storage.max_chunk_size' parameter. Light optimization: validation of available space in buffer now uses integer division instead of floating point multiplication (should be faster). Signed-off-by: Castor Sky <[email protected]>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThe changes introduce configuration-based control for the maximum input chunk size in fluent-bit. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70b94ff0ad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| /* Set up total reading size threshold */ | ||
| maximum_threshold_size = flb_input_chunk_get_max_size(config) / 100 * MAXIMUM_THRESHOLD_PERCENT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include flb_input_chunk.h before calling max-size helper
The new call to flb_input_chunk_get_max_size is added without including its declaration, so on C99/C11 toolchains that treat implicit function declarations as errors (or with -Werror), this will fail to build. Even if it compiles as a warning, the call is assumed to return int, so configurations with storage.max_chunk_size larger than INT_MAX will be truncated when computing maximum_threshold_size, leading to an incorrect (too small) read limit. Adding the header avoids the implicit declaration and preserves the correct return type.
Useful? React with 👍 / 👎.
…threshold Used configurable parameter 'storage.max_chunk_size' to calculate reading size threshold instead of fixed FLB_INPUT_CHUNK_FS_MAX_SIZE. Unnecessary type conversions were removed (all related variables are `size_t`). Introduced MAXIMUM_THRESHOLD_PERCENT to replace MAXIMUM_THRESHOLD_SIZE for calculation of threshold as percentage of user configured parameter. Signed-off-by: Castor Sky <[email protected]>
70b94ff to
5c70876
Compare
Introduced new key
storage.max_chunk_sizefor theserviceblock in configuration. This key regulates maximum size of buffer chunk for input plugins that use the filesystem buffer.Default value of
2048000was preserved for compatibility with older configurations.Getter function for the value of
storage.max_chunk_sizeis exposed for usage by other plugins. Thein_winevtlogwas patched to use this function for calculation of read threshold size.This PR addresses #10327.
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:
Variant 1 (default value):
Variant 2 (max_chunk_size=16 KB):
Log output for variant 1
Log output for variant 2
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
PR for documentation
Backporting
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.
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.