Skip to content

LimitReader copies bytes instead of slicing so the underlying big array can be freed#11524

Merged
kvch merged 5 commits intoelastic:masterfrom
kvch:fix-filebeat-copy-instead-of-slicing
Apr 16, 2019
Merged

LimitReader copies bytes instead of slicing so the underlying big array can be freed#11524
kvch merged 5 commits intoelastic:masterfrom
kvch:fix-filebeat-copy-instead-of-slicing

Conversation

@kvch
Copy link
Copy Markdown
Contributor

@kvch kvch commented Mar 29, 2019

In LimitReader when truncating the line if the configured limit was reached, the message was sliced. Slicing does not touch the underlying array. To make sure the long line can be truncated and freed, the reader copies the contents to a new array. Thus, freeing the data.

@kvch kvch added in progress Pull request is currently in progress. discuss Issue needs further discussion. review libbeat labels Mar 29, 2019
@kvch kvch requested a review from a team as a code owner March 29, 2019 09:54
Comment thread libbeat/reader/readfile/limit.go Outdated
@kvch kvch force-pushed the fix-filebeat-copy-instead-of-slicing branch from b40de8b to 6921dc2 Compare April 15, 2019 09:56
@kvch kvch removed discuss Issue needs further discussion. in progress Pull request is currently in progress. labels Apr 15, 2019
@kvch
Copy link
Copy Markdown
Contributor Author

kvch commented Apr 15, 2019

Fixed and added changelog.

Comment thread CHANGELOG.next.asciidoc Outdated
@kvch
Copy link
Copy Markdown
Contributor Author

kvch commented Apr 16, 2019

Only reworded changelog entry, merging as before everything was green.

@kvch kvch merged commit 72bc454 into elastic:master Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants