Skip to content

in_tail: fix handling of encoding parameter#5010

Merged
daipom merged 3 commits into
fluent:masterfrom
Watson1978:encoding
Jun 26, 2025
Merged

in_tail: fix handling of encoding parameter#5010
daipom merged 3 commits into
fluent:masterfrom
Watson1978:encoding

Conversation

@Watson1978

@Watson1978 Watson1978 commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:
Fixes #4863

What this PR does / why we need it:
If it configures encoding only (without from_encoding), it will convert the string encoding unexpectedly and it might break the string.

This PR will fix this behavior and we can handle the string correctly.
As a result, the behavior will be aligned with the documented in https://docs.fluentd.org/input/tail#encoding-from_encoding .

Docs Changes:
Not needed.

Release Note:
in_tail: fixed where specifying only encoding parameter might cause data corruption (affects since v0.14.12).

@Watson1978 Watson1978 force-pushed the encoding branch 4 times, most recently from 4734262 to 7f0dcb4 Compare June 25, 2025 02:40
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 changed the title encoding in_tail: fix handling of encoding parameter Jun 25, 2025
@Watson1978 Watson1978 marked this pull request as ready for review June 26, 2025 00:43
@Watson1978 Watson1978 requested review from daipom and kenhys June 26, 2025 00:43

@daipom daipom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!
I have added code refactoring.
Could you please check it?

Comment thread test/plugin/test_in_tail.rb Outdated
Comment thread lib/fluent/plugin/in_tail.rb
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 requested a review from daipom June 26, 2025 04:27
@daipom daipom added this to the v1.19.0 milestone Jun 26, 2025
@daipom

daipom commented Jun 26, 2025

Copy link
Copy Markdown
Contributor

Could you please prepare the release note?

Release Note:
TODO

@Watson1978

Copy link
Copy Markdown
Contributor Author

Could you please prepare the release note?

Added

@daipom daipom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@daipom daipom merged commit 619e6b0 into fluent:master Jun 26, 2025
14 of 16 checks passed
@Watson1978 Watson1978 deleted the encoding branch June 27, 2025 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

in_tail: encoding option does not work

2 participants