-
-
Notifications
You must be signed in to change notification settings - Fork 95
Don't overwrite line content after a read timeout #1276
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
Conversation
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.
In general while this should fix the issue where a valid line has a large pause while it is read, it looks like it symmetrically breaks the use where a line is interrupted and never completed, so the next valid line is discarded because it has junk in the beginning.
I wonder if we shouldn't have two separate timeouts for these cases, e.g. something like 30s to wait for the completion of a line and 500ms until we trigger a flush of the current table slice that was created from all finished lines.
Otherwise, if we're convinced that the first kind of error is more important to have fixed than the second kind, I'd also be ok with merging this.
From my understanding it only breaks if we hit a timeout in the middle of a line and the next data that arrives already belongs to the next line/event. I assume that to be extremely rare. |
4722bb7
to
192b09a
Compare
The reader implementations got incomplete lines on resuming after a timeout before this change. The old code cleared the line content on every call to getline, which is incorrect if the content wasn't parsed yet.
This reflects the changed behavior of not clearing the content of the output argument any more.
192b09a
to
8acec7f
Compare
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.
After some external discussion it seems like the regression is an intentional trade-off, so no objections from me.
📔 Description
Fix incomplete events when a timeout is hit in the middle of a line.
📝 Checklist
🎯 Review Instructions
By commit. You can check before / after with: