Skip to content
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

[ISSUE #4] Addressing infinite loop and undersized default buffer #7

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

lmnewton
Copy link
Owner

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

@lmnewton lmnewton marked this pull request as draft July 10, 2024 01:28
@lmnewton lmnewton marked this pull request as ready for review July 10, 2024 01:36
@lmnewton lmnewton marked this pull request as draft July 10, 2024 02:24
@lmnewton lmnewton marked this pull request as ready for review July 10, 2024 02:26
@lmnewton lmnewton merged commit 2fad78a into main Jul 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Developer mode hangs on large files when a search_term is present
1 participant