Skip to content

Conversation

@eschabell
Copy link
Contributor

@eschabell eschabell commented Dec 1, 2025

The config_map entry for the oneshot option was incorrectly using 'bool' as the configuration key instead of 'oneshot'. This made the configuration inconsistent with the regular in_exec plugin and confusing for users.

Fixes #11232.

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

Testing

  • [N/A ] Example configuration file for the change
  • [N/A ] Debug log output from testing the change
  • [N/A ] Attached Valgrind output that shows no leaks or memory corruption was found
  • [N/A ] Run local packaging test showing all targets (including any new ones) build.
  • [N/A ] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [X ] Documentation required for this feature

Doc fix PR: fluent/fluent-bit-docs#2248

Backporting

  • [N/A ] 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.

Summary by CodeRabbit

  • Bug Fixes
    • Renamed the configuration option in the WASI execution plugin from "bool" to "oneshot" for improved clarity and better reflects the parameter's functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

The config_map entry for the oneshot option was incorrectly using 'bool'
as the configuration key instead of 'oneshot'. This made the configuration
inconsistent with the regular in_exec plugin and confusing for users.

Signed-off-by: Eric D. Schabell <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Dec 1, 2025

Walkthrough

The configuration map entry in the WASI exec input plugin is corrected by renaming the boolean flag option key from "bool" to "oneshot" to align with the standard in_exec plugin and match the underlying struct field name.

Changes

Cohort / File(s) Change Summary
Configuration key rename
plugins/in_exec_wasi/in_exec_wasi.c
Changed FLB_CONFIG_MAP_BOOL entry key from "bool" to "oneshot" to match in_exec plugin convention and struct field name

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-line string replacement in one configuration map entry
  • Verify alignment with in_exec plugin configuration and struct field offset

Suggested labels

docs-required

Suggested reviewers

  • edsiper
  • cosmo0920

Poem

🐰 A config key was wearing the wrong name,
"bool" instead of "oneshot"—oh what a shame!
One little fix, and now they align,
The WASI exec plugin will work just fine! 🔧✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: correcting a config key typo from 'bool' to 'oneshot' in the in_exec_wasi plugin, and references the related issue #11232.
Linked Issues check ✅ Passed The code change directly addresses the bug reported in issue #11232 by correcting the config_map entry key from 'bool' to 'oneshot', aligning with the in_exec plugin and meeting all stated objectives.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to fixing the specific config key typo in the configuration map entry, with no unrelated or extraneous modifications to the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
plugins/in_exec_wasi/in_exec_wasi.c (1)

456-459: Config key rename is correct; consider optional backward‑compat alias

Renaming the FLB_CONFIG_MAP_BOOL key from "bool" to "oneshot" matches the struct flb_exec_wasi::oneshot field and the rest of the oneshot control flow (init, config, prerun, collect). No additional code changes are needed for correctness.

The only trade‑off is that existing configs using bool will stop working. If you want to preserve backward compatibility, you could optionally add a second, deprecated entry pointing at the same offset, e.g.:

     {
       FLB_CONFIG_MAP_BOOL, "oneshot", "false",
       0, FLB_TRUE, offsetof(struct flb_exec_wasi, oneshot),
       "execute the command only once"
     },
+    {
+      FLB_CONFIG_MAP_BOOL, "bool", "false",
+      0, FLB_TRUE, offsetof(struct flb_exec_wasi, oneshot),
+      "DEPRECATED: use 'oneshot' instead"
+    },

This keeps existing configs working while steering users to oneshot.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10ebd3a and b5a7719.

📒 Files selected for processing (1)
  • plugins/in_exec_wasi/in_exec_wasi.c (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: shadowshot-x
Repo: fluent/fluent-bit PR: 10825
File: plugins/out_s3/s3.c:0-0
Timestamp: 2025-09-04T12:32:46.030Z
Learning: In Fluent Bit plugins, avoid creating plugin-local config_map entries that duplicate core functionality. The core already provides Retry_Limit parsed into ins->retry_limit, so plugins should use that directly rather than defining their own retry_limit configuration option.
📚 Learning: 2025-09-04T12:32:46.030Z
Learnt from: shadowshot-x
Repo: fluent/fluent-bit PR: 10825
File: plugins/out_s3/s3.c:0-0
Timestamp: 2025-09-04T12:32:46.030Z
Learning: In Fluent Bit plugins, avoid creating plugin-local config_map entries that duplicate core functionality. The core already provides Retry_Limit parsed into ins->retry_limit, so plugins should use that directly rather than defining their own retry_limit configuration option.

Applied to files:

  • plugins/in_exec_wasi/in_exec_wasi.c
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (31)
  • GitHub Check: pr-windows-build / call-build-windows-package (Windows 64bit, x64, x64-windows-static, 3.31.6)
  • GitHub Check: pr-windows-build / call-build-windows-package (Windows 64bit (Arm64), amd64_arm64, -DCMAKE_SYSTEM_NAME=Windows -DCMA...
  • GitHub Check: pr-windows-build / call-build-windows-package (Windows 32bit, x86, x86-windows-static, 3.31.6)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_ARROW=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_COMPILER_STRICT_POINTER_TYPES=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_COVERAGE=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, clang, clang++)
  • GitHub Check: PR - fuzzing test
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, clang, clang++)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, gcc, g++, ubuntu-24.04, clang-14)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, clang, clang++, ubuntu-24.04, clang-14)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, gcc, g++, ubuntu-22.04, clang-12)
  • GitHub Check: pr-compile-system-libs (-DFLB_PREFER_SYSTEM_LIBS=On, 3.31.6, clang, clang++, ubuntu-22.04, clang-12)
  • GitHub Check: pr-compile-centos-7
  • GitHub Check: pr-compile-without-cxx (3.31.6)

Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

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

Wow, I didn't notice about this error. Thank you for your fix!

@edsiper edsiper merged commit 1f37de5 into fluent:master Dec 3, 2025
56 of 57 checks passed
@eschabell eschabell deleted the erics_in_exec_wasi_bool_fix branch December 4, 2025 08:40
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.

in_exec_wasi: bug in config map for FLB_CONFIG_MAP_BOOL variable using "bool" instead of "oneshot"

3 participants