cloudagents: increase scanner buffer to avoid token too long errors#903
Open
c-tonneslan wants to merge 1 commit into
Open
cloudagents: increase scanner buffer to avoid token too long errors#903c-tonneslan wants to merge 1 commit into
c-tonneslan wants to merge 1 commit into
Conversation
bufio.Scanner defaults to a 64KB max token size. Docker build output and agent logs can produce lines longer than that, especially during package installs (e.g. pip), causing "bufio.Scanner: token too long". Bump the max to 4MB in both the build and log scanners. This matches what lk agent deploy --silent users hit in practice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes livekit/livekit-cli#822.
bufio.Scannerhas a default max token size of 64KB. Docker build output and agent logs can exceed this, particularly during package installs like pip, which causeslk agent deploy --silentto crash with:Bump the max to 4MB in both the build status scanner (
build.go) and the log streaming scanner (logs.go). The initial buffer stays at the default 64KB — we're just raising the ceiling for lines that need more.