Skip to content

routing: fix issue with missing input alias [Backport to 4.2]#11864

Merged
cosmo0920 merged 2 commits into
4.2from
routing-issue-4.2
May 28, 2026
Merged

routing: fix issue with missing input alias [Backport to 4.2]#11864
cosmo0920 merged 2 commits into
4.2from
routing-issue-4.2

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented May 28, 2026

Backporting of #11717 except for integration testing commit:
f5dd9f8


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.

edsiper added 2 commits May 28, 2026 17:50
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@cosmo0920 cosmo0920 requested a review from edsiper as a code owner May 28, 2026 08:52
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97a1f62b-a644-4240-a864-c0b2f6c9b2ad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch routing-issue-4.2

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
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a 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: e87660883c

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/flb_router_config.c
cfl_list_init(&input->routes);
input->has_alias = FLB_FALSE;
input->instance = NULL;
input->instance = find_input_instance_by_index(config, input_index);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve alias lookup when earlier inputs already exist

When a config file is loaded into a flb_ctx_t that already has inputs added through the public API (flb_input() appends to config->inputs, and flb_lib_config_file() then loads sections into the same config), this pre-binds the first file input’s routes to input index 0 in the whole config, not index 0 among inputs created from that file. For an aliased input section, the previous alias lookup would still find the file-created instance, but now find_input_instance() returns this preselected instance immediately, so routes from the config section can be applied to an unrelated earlier programmatic input.

Useful? React with 👍 / 👎.

@cosmo0920 cosmo0920 merged commit 6faf17f into 4.2 May 28, 2026
27 checks passed
@cosmo0920 cosmo0920 deleted the routing-issue-4.2 branch May 28, 2026 09:31
@cosmo0920 cosmo0920 added this to the Fluent Bit v4.2.5 milestone May 29, 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.

2 participants