Skip to content
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

reload: bin: filter: handle invalid values of configuration correctly on hot reloading #8110

Conversation

cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Oct 31, 2023

On hot-reloading, we intended to keep fluent-bit process as much as possible when an error is included in the loaded configuration file.
However, the current behavior is not ideal for containing invalid values for provided valid parameters in the configuration file during hot-reloading. This PR is mainly for filter_lua case which is loaded invalid lua script as described in #8067.
In this situation, we should validate malformed values especially for Lua script.
In filter_lua, fluent-bit isn't able to process events when loading an invalid Lua script. This should be halted for hot-reloading process.

Related to #8067


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.

@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 07:54 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 07:54 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 07:54 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 08:23 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 marked this pull request as ready for review October 31, 2023 09:17
In our hot-reloading context handling, there is a possibility not to
able to handle hot-reloading correctly.
For this case, we should treat as error and halt the process.

Signed-off-by: Hiroshi Hatake <[email protected]>
@cosmo0920 cosmo0920 force-pushed the cosmo0920-handle-invalid-values-of-configuration-correctly-on-hot-reloading branch from e31cbdb to 8eb112a Compare October 31, 2023 09:21
@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 09:21 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 09:21 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 09:21 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr October 31, 2023 09:51 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 marked this pull request as draft October 31, 2023 14:34
@cosmo0920 cosmo0920 marked this pull request as ready for review October 31, 2023 14:42
…er plugins

.cb_pre_run should be provided for filter plugins that is easily to get faulty
statuses.
For now, it's going to be used only for filter_lua.

Signed-off-by: Hiroshi Hatake <[email protected]>
@cosmo0920 cosmo0920 temporarily deployed to pr November 1, 2023 05:53 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr November 1, 2023 05:53 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr November 1, 2023 05:53 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 temporarily deployed to pr November 1, 2023 06:20 — with GitHub Actions Inactive
@cosmo0920 cosmo0920 changed the title reload: bin: handle invalid values of configuration correctly on hot reloading reload: bin: filter: handle invalid values of configuration correctly on hot reloading Nov 1, 2023
@edsiper edsiper merged commit ac0be2f into master Nov 4, 2023
43 of 44 checks passed
@edsiper edsiper deleted the cosmo0920-handle-invalid-values-of-configuration-correctly-on-hot-reloading branch November 4, 2023 22:18
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.

2 participants