-
Notifications
You must be signed in to change notification settings - Fork 66
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
flush codec after decode #81
flush codec after decode #81
Conversation
spec/inputs/http_spec.rb
Outdated
@@ -145,6 +146,20 @@ def do_post | |||
end | |||
end | |||
|
|||
context "with json_lines codec without final delimiter" do | |||
subject { LogStash::Inputs::Http.new("port" => port, "codec" => "json_lines") } |
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.
can't we test this with line
codec so we don't have to rely on a new feature of json_lines?
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.
yeah I guess so.
@jsvd as you suggested I switched to the line codec, good suggestion. |
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 pending on green (other than known build timeouts)
restarted build - seems like the build issues are now solved. |
Green. Will squash, bump version, merge and publish. |
remove local tweak to gemfile use line codec instead of json_lines
9a6dfad
to
51177d6
Compare
actually - I will create another PR for the version bump since it will also reference #80. |
version bump PR in #82 |
This has been released in v3.0.9 |
This PR depends on logstash-plugins/logstash-codec-json_lines#35
The http input only accepts self-contained payload for each request and multipart is not supported. Because of this, we should always flush the codec after each request & codec decode calls to avoid situations where a delimited content missing a final delimiter, for example, would linger in the codec.
This is similar in nature to the discussion in elastic/logstash#8830 (comment)
Spec added to test this condition. Otherwise codec support is also well tested in the current spec.