Skip to content

Commit

Permalink
Merge #108850
Browse files Browse the repository at this point in the history
108850: cli: Increase `debug doctor` scanner limit from 50MiB to 200MiB r=Xiang-Gu a=Xiang-Gu

We encountered a debug zip where its `system.jobs.txt` file contain extrememly long line (>50MiB for that line), and cause commands within `debug doctor` (e.g. `examine zipdir`) to fail with
```
ERROR: bufio.Scanner: token too long
Failed running "debug doctor examine zipdir"
```
This commit increases the scanner buffer limit from 50MiB to 200MiB to handle those cases.

Epic: None
Release note: None

Co-authored-by: Xiang Gu <[email protected]>
  • Loading branch information
craig[bot] and Xiang-Gu committed Aug 16, 2023
2 parents 85f5583 + e566fa7 commit 5d153c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cli/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ func slurp(zipDirPath string, fileName string, tableMapFn func(row string) error
func tableMap(in io.Reader, fn func(string) error) error {
firstLine := true
sc := bufio.NewScanner(in)
// Read lines up to 50 MB in size.
sc.Buffer(make([]byte, 64*1024), 50*1024*1024)
// Read lines up to 200 MB in size.
sc.Buffer(make([]byte, 64*1024), 200*1024*1024)
for sc.Scan() {
if firstLine {
firstLine = false
Expand Down

0 comments on commit 5d153c1

Please sign in to comment.