Sitelet https://github.com/fluent/fluentd/pull/5520
Skip to content

in_tail: extract line parsing and emitting into LineFeeder - #5520

Merged
Watson1978 merged 1 commit into
masterfrom
refactor/in_tail-line-feeder
Oct 6, 2026
Merged

Watson1978 merged 1 commit into
masterfrom
refactor/in_tail-line-feeder

Conversation

@ashie

@ashie ashie commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
Separate line parsing and event emission from TailInput's watcher
lifecycle. This prepares in_tail for managing per-file processing state
independently and future concurrent file processing without changing the
current behavior.

Keep TailInput's line-processing methods as compatibility entry points so
plugins inheriting TailInput can continue to override them.

Add regression tests for the existing entry points and subclass overrides.

Docs Changes:
None

Release Note:
None

Assisted-by: LLM Qwen3.8-Flash-Next

@Watson1978

Watson1978 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the refactoring.
I'd like to backport this PR to v1.19.
Then future in_tail fixes can be backported without conflicts. For that, this change needs to keep the existing behavior.

Right now it breaks plugins that inherit Fluent::Plugin::TailInput and override receive_lines. IOHandler now calls @line_feeder.method(:feed_lines) directly, so the override is never called.

Could you keep TailInput#receive_lines and #flush_buffer, and make them delegate to @line_feeder? If IOHandler keeps calling method(:receive_lines), overrides in subclasses keep working.

Here are the plugins that inherit Fluent::Plugin::TailInput and override its methods.

There may also be private plugins that do the same....

@ashie

ashie commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Oops, there are more plugins that depend on in_tail than I had anticipated...
I'll consider the matter of compatibility, but implementing multi-threading while maintaining it will likely be difficult...

@ashie
ashie marked this pull request as draft October 5, 2026 09:48
@ashie
ashie force-pushed the refactor/in_tail-line-feeder branch 3 times, most recently from 5e05c00 to 17accd3 Compare October 6, 2026 01:03
**Which issue(s) this PR fixes**:
Fixes #

**What this PR does / why we need it**:
Separate line parsing and event emission from TailInput's watcher
lifecycle. This prepares in_tail for managing per-file processing state
independently and future concurrent file processing without changing the
current behavior.

Keep TailInput's line-processing methods as compatibility entry points so
plugins inheriting TailInput can continue to override them.

Add regression tests for the existing entry points and subclass overrides.

**Docs Changes**:
None

**Release Note**:
None

Assisted-by: LLM Qwen3.8-Flash-Next
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
@ashie
ashie force-pushed the refactor/in_tail-line-feeder branch from 17accd3 to a690c93 Compare October 6, 2026 01:40
@ashie

ashie commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

I've revived compatibility endpoints for third party plugins.

@ashie
ashie marked this pull request as ready for review October 6, 2026 04:50
@Watson1978 Watson1978 added this to the v1.20.0 milestone Oct 6, 2026
@Watson1978 Watson1978 added the backport to v1.19 We will backport this fix to the LTS branch label Oct 6, 2026
@Watson1978
Watson1978 merged commit d3814e8 into master Oct 6, 2026
23 of 24 checks passed
@Watson1978
Watson1978 deleted the refactor/in_tail-line-feeder branch October 6, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to v1.19 We will backport this fix to the LTS branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants