Pr5449 verify - #59
Closed
Watson1978 wants to merge 6 commits into
Closed
Watson1978 wants to merge 6 commits into
Watson1978 wants to merge 6 commits into
Conversation
**Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: json 3.0 dropped the positional options argument from `JSON.parse`, so every call passing `Fluent::DEFAULT_JSON_PARSE_OPTIONS` now fails with `ArgumentError: wrong number of arguments (given 2, expected 1)`. Ref. https://github.com/fluent/fluentd/actions/runs/34311091836 Pass the options as keyword arguments instead. **Docs Changes**: N/A **Release Note**: * Support json gem v3.x Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
The byte-index path added for the space after the RFC3164 priority mixed byte offsets with the character offsets used by String#slice. A UTF-8 header carrying a multibyte character was handed to the time parser instead of being rejected. Drop that path and check the priority digits on the substring itself, guard the space_count branch against a truncated header in both the string and the regexp parser, and search for the subsecond delimiter from the end of the timestamp. Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Watson1978
force-pushed
the
pr5449-verify
branch
from
September 9, 2026 07:29
13243b1 to
9318787
Compare
|
|
||
| param = if val.is_a?(String) | ||
| val.start_with?('{') ? JSON.parse(val, Fluent::DEFAULT_JSON_PARSE_OPTIONS) : Hash[val.strip.split(/\s*,\s*/).map{|v| v.split(':', 2)}] | ||
| val.start_with?('{') ? JSON.parse(val, **Fluent::DEFAULT_JSON_PARSE_OPTIONS) : Hash[val.strip.split(/\s*,\s*/).map{|v| v.split(':', 2)}] |
|
|
||
| param = if val.is_a?(String) | ||
| val.start_with?('[') ? JSON.parse(val, Fluent::DEFAULT_JSON_PARSE_OPTIONS) : val.strip.split(/\s*,\s*/) | ||
| val.start_with?('[') ? JSON.parse(val, **Fluent::DEFAULT_JSON_PARSE_OPTIONS) : val.strip.split(/\s*,\s*/) |
Accepting the boundary space moves the cursor one character forward, so a record whose timestamp is malformed can line up with the fixed-width lookup and reach the time parser. The string parser then raised Fluent::TimeParser::TimeParseError where it used to yield nil, nil. RFC 3164 asks receivers to be liberal in what they accept and not to malfunction on malformed messages, and in_tail cannot apply emit_unmatched_lines once the parser raises. Turn the error back into the documented nil, nil rejection. Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Owner
Author
|
Superseded by the changes pushed directly to fluent#5449. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue(s) this PR fixes:
Fixes #
What this PR does / why we need it:
Docs Changes:
Release Note: