This repository has been archived by the owner on May 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Fix bug where splitting could be skipped #303
Merged
Merged
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
When force_flush_period is set to a non-zero value, a forced flushing operation would disregard the possibility that the data being flushed may contain multiple entries. For example, the file_input operator could flush the remainder of a file that it was consuming. If multiple lines were written to that file, they would be emitted as a single log entry.
djaglowski
force-pushed
the
force-split
branch
from
November 9, 2021 20:04
5916113
to
a4d8694
Compare
Codecov Report
@@ Coverage Diff @@
## main #303 +/- ##
=======================================
- Coverage 77.0% 77.0% -0.1%
=======================================
Files 94 94
Lines 4410 4408 -2
=======================================
- Hits 3397 3395 -2
Misses 697 697
Partials 316 316
|
jsirianni
approved these changes
Nov 10, 2021
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.
Initial testing looks good, I believe the issue is resolved. My process looks like this:
- Deploy GKE cluster and replicate the issue using the OTEL example and the Google Micro Service Demo
- Observed the issue pretty quickly. Sometimes, logs would be appended to each other during a forced flush.
- Verified that setting
force_flush_period
to0
prevents the issue from happening - Reverted step 3, observed the issue again
- Deployed this fix by building Collector Contrib against this branch
- Verified that the issue is no longer happening
dmitryax
approved these changes
Nov 13, 2021
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. Thanks for fixing it!
djaglowski
added a commit
to djaglowski/opentelemetry-log-collection
that referenced
this pull request
Nov 30, 2021
- `combine_with` setting to `recombine` operator, to allow for joining on custom delimiter ([PR315](open-telemetry#315)) - Issue where `force_flush_period` could cause line splitting to be skipped ([PR303](open-telemetry#303)) - Issue where `tcp_input` and `udp_input` could panic when stopping ([PR273](open-telemetry#273)) - Syslog severity mapping is now aligned with log specification ([PR300](open-telemetry#300)) - Improve error message when timezone database is not found ([PR289](open-telemetry#289))
djaglowski
added a commit
that referenced
this pull request
Nov 30, 2021
- `combine_with` setting to `recombine` operator, to allow for joining on custom delimiter ([PR315](#315)) - Issue where `force_flush_period` could cause line splitting to be skipped ([PR303](#303)) - Issue where `tcp_input` and `udp_input` could panic when stopping ([PR273](#273)) - Syslog severity mapping is now aligned with log specification ([PR300](#300)) - Improve error message when timezone database is not found ([PR289](#289))
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves #292
When force_flush_period is set to a non-zero value,
a forced flushing operation would disregard the possibility
that the data being flushed may contain multiple entries.
For example, the file_input operator could flush the remainder
of a file that it was consuming. If multiple lines were written
to that file, they would be emitted as a single log entry.
The fix is basically that when a forced flush is required, we
will continue reading in lines until reaching the end of file.
Only then will we mark the flush complete.