-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix BufferedTokenizer to properly resume after a buffer full condition respecting the encoding of the input string #16968
Open
andsel
wants to merge
9
commits into
elastic:main
Choose a base branch
from
andsel:fix/buffered_tokenizer_clean_state_in_case_of_line_too_big_respecting_character_encoding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+394
−17
Conversation
This file contains 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
andsel
force-pushed
the
fix/buffered_tokenizer_clean_state_in_case_of_line_too_big_respecting_character_encoding
branch
from
January 28, 2025 16:02
69bd4f4
to
a84656e
Compare
It looks like this PR modifies one or more |
📃 DOCS PREVIEW ✨ https://logstash_bk_16968.docs-preview.app.elstc.co/diff |
…as the same encoding
…g and avoid implicit deconding in addAll iterator
…h data input encoding, to do not change encoding
andsel
force-pushed
the
fix/buffered_tokenizer_clean_state_in_case_of_line_too_big_respecting_character_encoding
branch
from
January 31, 2025 12:40
b682c20
to
b42ca05
Compare
Quality Gate passedIssues Measures |
💚 Build Succeeded
History
cc @andsel |
andsel
changed the title
Fix/buffered tokenizer clean state in case of line too big respecting character encoding
Fix BufferedTokenizer to properly resume after a buffer full condition respecting the encoding of the input string
Jan 31, 2025
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.
Release notes
[rn:skip]
What does this PR do?
This is a second take to fix the processing of tokens from the tokenizer after a buffer full error. The first try #16482 was rollbacked to the encoding error #16694.
The first try failed on returning the tokens in the same encoding of the input.
This PR does a couple of things:
concat
method instead ofaddAll
, which avoid to convert RubyString to String and back to RubyString. When return the headStringBuilder
it enforce the encoding with the input charset.Why is it important/What is the impact to the user?
Permit to use effectively the tokenizer also in context where a line is bigger than a limit.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
How to test this PR locally
The test plan has two sides:
How to test the encoding is respected
Startup a REPL with Logstash and exercise the tokenizer:
or use the following script
with the Logstash run as
bin/logstash -e "input { tcp { port => 1234 codec => line { charset => 'ISO8859-1' } } } output { stdout { codec => rubydebug } }"
In the output the
£
as to be present and not£
Related issues
BufferedTokenizerExt
#16694