Closed wolfstudy closed 5 years ago
Thanks for the detailed logs and ways to reproduce the issue.
fixing this one now.
| => coperctl --notls -s 127.0.0.1:18334 gettxoutsetinfo
==================
WARNING: DATA RACE
Read at 0x00c0001e98c0 by goroutine 81:
github.com/copernet/copernicus/persist/disk.FlushStateToDisk()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/persist/disk/disk.go:397 +0xd1b
github.com/copernet/copernicus/rpc.handleGetTxoutSetInfo()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcblockchain.go:755 +0x86
github.com/copernet/copernicus/rpc.(*Server).standardCmdResult()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcserver.go:217 +0x1f6
github.com/copernet/copernicus/rpc.(*Server).jsonRPCRead()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcserver.go:378 +0x1d4a
github.com/copernet/copernicus/rpc.(*Server).Start.func1()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/rpc/rpcserver.go:448 +0x43e
net/http.HandlerFunc.ServeHTTP()
/usr/local/opt/go/libexec/src/net/http/server.go:1964 +0x6f
net/http.(*ServeMux).ServeHTTP()
/usr/local/opt/go/libexec/src/net/http/server.go:2361 +0x2cb
net/http.serverHandler.ServeHTTP()
/usr/local/opt/go/libexec/src/net/http/server.go:2741 +0x34e
net/http.(*conn).serve()
/usr/local/opt/go/libexec/src/net/http/server.go:1847 +0x1f7b
Previous write at 0x00c0001e98c0 by goroutine 76:
runtime.mapassign()
/usr/local/opt/go/libexec/src/runtime/map.go:549 +0x0
github.com/copernet/copernicus/persist.(*PersistGlobal).AddDirtyBlockIndex()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/persist/global.go:56 +0xb2
github.com/copernet/copernicus/model/chain.(*Chain).AddToIndexMap()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/model/chain/chain.go:594 +0x969
github.com/copernet/copernicus/logic/lblock.AcceptBlockHeader()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/logic/lblock/lblock.go:311 +0x3d3
github.com/copernet/copernicus/service.ProcessBlockHeader()
/Users/bj1809120051/.go/src/github.com/copernet/copernicus/service/blockservice.go:19 +0x29e
github.com/copernet/copernicus/net/syncmanager.(*SyncManager).handleHeadersMsg()
tests after fix Tested from clean testnet env, the IBD will 1) get all headers and 2)get historical blocks.
watch -d -n 5 'coperctl --notls -s 127.0.0.1:18334 gettxoutsetinfo'
test logs:
Every 5.0s: coperctl --notls -s 127.0.0.1:18334 gettxoutsetinfo Tue Dec 18 13:27:01 2018
{
"height": 40323,
"bestblock": "0000000025e580fdacf8b6f98f59d68333dcbae9e2a918a70eeb544aeac6351f",
"transactions": 35537,
"txouts": 35558,
"bogosize": 4189250,
"hash_serialized": "18784f0a4c52fc033864d6f2d72c26708df251799fb3af4d76fb07479882bce6",
"disk_size": 2557176,
"total_amount": 2016150
}
Smartphone (please complete the following information):
Context
The code is the latest code of the current copernicus. When I use
./copernicus --testnet
to start, everything ok. At this time, when I use the exporter of prometheus to get the RPC interface of the copernicus client, the following error occurs:For detailed error information, please download this link below:
coper_error.log
when i use
go build -race
, continue to repeat the above steps and try to reproduce the problem, the error log:coper_race_error.log
Important logs are as follows:
the exporter of copernicus is a long connect that repeatedly calls the form of RPC, the error:
This problem can be repeated over and over again.