Repository navigation
Conversation
Without <extract>, in_tcp called router.emit_stream after every read, also when the read did not complete a message. A long message that arrives in many reads made the router, filters and output run once per read with an empty stream, and inflated the output's emit_count. Emit only when the stream has events, like the <extract> path already does. Fixes fluent#5602 Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
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 #5602
What this PR does / why we need it:
Without
<extract>,in_tcpcalledrouter.emit_stream(@tag, es)after every read, also when the read did not complete any message andeswas empty. A long message that arrives in many reads made the router, the filters and the output run once per read with an empty stream, and each call counted in the output'semit_count. This emits only wheneshas events, which is what the<extract>path already does (it emits per record).Test: a new case in the
delimitersub test case (bothbatch_emitandsingle_emit) sendshel, waits, then sendslo\n, and checks that one record arrives in one emit. On master the batch case fails withemit_count2 instead of 1. All 28 tests intest/plugin/test_in_tcp.rbpass.Docs Changes:
None.
Release Note:
in_tcp: skip emitting an empty event stream when a read has no complete message.