-
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
ensure inputSize state value is reset during buftok.flush #16760
Conversation
Quality Gate passedIssues Measures |
💚 Build Succeeded
|
logstash-core/src/main/java/org/logstash/common/BufferedTokenizerExt.java
Show resolved
Hide resolved
@@ -106,12 +106,13 @@ public RubyArray extract(final ThreadContext context, IRubyObject data) { | |||
public IRubyObject flush(final ThreadContext context) { | |||
final IRubyObject buffer = input.join(context); | |||
input.clear(); | |||
inputSize = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 this change does actually fix the issue where inputSize
is not reset on a flush.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to fix.
[EDIT: the bot doesn't like multiple branches in a single comment] |
@logstashmachine backport 8.x |
(cherry picked from commit e36cace)
@logstashmachine backport 8.17 |
@logstashmachine backport 8.16 |
(cherry picked from commit e36cace)
(cherry picked from commit e36cace)
The BufferedTokenizer.flush must reset the inputSize value back to zero on flush, otherwise it will grow until a buffer full exception is thrown if the buffer has a size limit.
We can see the test fails if the
inputSize = 0
is not present:But with it tests pass:
closes #16762