From f5f1416a149e525d9f48c8762c7999809d6e9395 Mon Sep 17 00:00:00 2001 From: bradyjoestar Date: Fri, 18 Jan 2019 16:09:12 +0800 Subject: [PATCH] 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 --- scripts/json2wal/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/json2wal/main.go b/scripts/json2wal/main.go index be3487e5f..9611b9b56 100644 --- a/scripts/json2wal/main.go +++ b/scripts/json2wal/main.go @@ -45,7 +45,10 @@ func main() { } 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) for {