Browse Source

json2wal: increase reader's buffer size (#3147)

```
panic: failed to unmarshal json: unexpected end of JSON input

goroutine 1 [running]:
main.main()
	/root/gelgo/src/github.com/tendermint/tendermint/scripts/json2wal/main.go:66 +0x73f
```

Closes #3146
pull/3164/head v0.29.0-beta0
bradyjoestar 6 years ago
committed by Anton Kaliaev
parent
commit
f5f1416a14
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      scripts/json2wal/main.go

+ 4
- 1
scripts/json2wal/main.go View File

@ -45,7 +45,10 @@ func main() {
} }
defer walFile.Close() defer walFile.Close()
br := bufio.NewReader(f)
// the length of tendermint/wal/MsgInfo in the wal.json may exceed the defaultBufSize(4096) of bufio
// because of the byte array in BlockPart
// leading to unmarshal error: unexpected end of JSON input
br := bufio.NewReaderSize(f, 2*types.BlockPartSizeBytes)
dec := cs.NewWALEncoder(walFile) dec := cs.NewWALEncoder(walFile)
for { for {


Loading…
Cancel
Save