-
Notifications
You must be signed in to change notification settings - Fork 157
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: switch to bufio.Reader for KubeTask output parsing #2641
Conversation
bufio.Scanner has buffer limit and can fail the function if output is too big fixes #2612
@hairyhum The |
Guys, please correct me if I'm mistaken: When can we expect an issue?
What does this function do? What does the parsing function do? What do we know about the value in (3)?
We can assume that they are also compact. So, here's the (slightly more complex) solution I see: |
@e-sumin I agree that there's a risk of higher memory usage
So the assumption there would be that the output line bigger than 65kb would not have
If line is > 65kb right now - there's an error. As I understand, you propose to keep the assumptions with a difference that if the line is >65kb - it does not cause an error and just getting logged. The issue I see with it is that we introduce a hidden assumption which may silently ignore some lines with Alternative things we can do:
WDYT? Also for the limit of phase output value 65kb is rather small, we can bump it up a bit. |
New change follows the TODO: add unit tests. |
@hairyhum I've added some draft for unit test, which is able to generate random input. |
…rter lines Fix some out of bounds errors Don't run the tests twice
ad836c6
to
e24c134
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.
LGTM
Change Overview
Use
bufio.Reader
andReadLine
instead ofbufio.Scanner
bufio.Scanner
has buffer limit and can fail the function if output is too bigPull request type
Please check the type of change your PR introduces:
Issues
Test Plan