[ISSUE #4] Addressing infinite loop and undersized default buffer #7
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.
There might be two separate causes for this and both should be addressed with this PR.
The buffer size in dev mode is set lower than in the docker container. This isn't really necessary as the buffer size is already sufficiently small in the container. I've increased the default to be 8192 to be consistent across run modes. There are already unit tests to consider smaller buffer sizes and those will stay in place but for practical use cases (large log files) undersizing the buffer is a mistake.
The other issue I encountered locally while tuning the default buffer size. There is an edge case where the last line of iteration fits exactly into the buffer. When this happens it's possible for an infinite loop to occur as the last buffer read happens infinitely. This has been addressed with a check if
scrollback == buffer_size
and unit tests on a new log file that triggers this behaviour.Closes #4