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

Limiting line length to 2K to avoid bufio.Scanner: token too long issues #1198

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

cboneti
Copy link
Member

@cboneti cboneti commented Apr 20, 2023

Under rare circumstances, the call to ansible-playbook omnia.yaml inside of our startup script will create a line that is longer than the bufio.Scanner limit.

This PR will limit this specific call outputs to 2048 characters to avoid these issues.

Submission Checklist

  • Have you installed and run this change against pre-commit? (pre-commit install)
  • Are all tests passing? (make tests)
  • Have you written unit tests to cover this change?
  • Is unit test coverage still above 80%?
  • Have you updated all applicable documentation?
  • Have you followed the guidelines in our Contributing document?

Copy link
Member

@tpdownes tpdownes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that tail -c 2048 is more likely to contain actionable information. Do you agree?

Another alternative might be something like:

cmd | split -b2000
for j in x[a-z][a-z]*; do cat $j; done

We do not have to completely over-engineer this hack but I'd rather not lose the information we want in the first place.

@tpdownes tpdownes assigned cboneti and unassigned tpdownes Apr 20, 2023
@tpdownes tpdownes assigned tpdownes and unassigned cboneti Apr 20, 2023
@cboneti cboneti merged commit 6071612 into GoogleCloudPlatform:develop Apr 20, 2023
@cboneti cboneti deleted the omnia-broken-pipe branch April 20, 2023 19:28
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.

2 participants