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
Fix notify silently fails #146
Conversation
parrasajad
commented
Jun 10, 2022
- set buffer to file size
- split line into multiple chunks if line size is greater than char-limit
…reater than char-limit
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@ehsandeep I'm having problems with this, I think it needs to be backed out. Before this PR was landed:
File-based and stdin with bulk and non-bulk all work. As of this PR being landed:
stdin is broken, and file-based bulk is broken I can see that this PR is getting the size of the infile. I suspect this breaks for stdin, and for file-based it could cause memory pressure given a large infile. I think we need to write a new |
@justinsteven thanks for pointing it out, it should be addressed in #149 |
This reverts commit 173f914.
* Revert "Fix notify silently fails (#146)" This reverts commit 173f914. * Emit logged lines to stdout, not stderr Fixes #134 (this was previously fixed but got backed out in landing #130) * Split lines as per CharLimit in non-bulk mode Resolves #137 * Bubble up any Scanner errors This surfaces the error that's causing #138: 'bufio.Scanner: token too long' * Fix infinite loop with -char-limit <= len('...') We're using '...' to indicate that a line has been truncated. If -char-limit was less than the length of this ellipsis string, the scanner would never terminate. Raise an error if the charLimit given to a splitter is <= len('...') * Ensure we never allow the Scanner buffer to fill We know we never need more than CharLimit chars from the Scanner in one go First of all, we ensure that the Scanner has a buffer which can hold at least CharLimit chars. Then we handle cases where the Scanner wants more data but we don't need it to get more data. Thus it should never end up in a place where its internal buffer is filled, and it should never return bufio.ErrToLong Fixes #138 * fmt.print => gologger Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>