iotexproject / iotex-core

Official implementation of IoTeX blockchain protocol in Go.
https://iotex.io
Apache License 2.0
1.54k stars 321 forks source link

p2p error #4072

Open CoderZhi opened 4 months ago

CoderZhi commented 4 months ago
{"level":"error","ts":"2024-01-26T15:43:17.168Z","caller":"go-p2p@v0.3.5/p2p.go:587","msg":"Error when sending a unicast message.","ioAddr":"io1llzp2lu6xrja9p3xvf2rdrx58z6en8meyr3669","error":"failed to connect the peer: context deadline exceeded","errorVerbose":"context deadline exceeded\nfailed to connect the peer\ngithub.com/iotexproject/go-p2p.(*Host).unicast\n\t/go/pkg/mod/github.com/iotexproject/go-p2p@v0.3.5/p2p.go:596\ngithub.com/iotexproject/go-p2p.(*Host).Unicast\n\t/go/pkg/mod/github.com/iotexproject/go-p2p@v0.3.5/p2p.go:586\ngithub.com/iotexproject/iotex-core/p2p.(*agent).UnicastOutbound\n\t/go/apps/iotex-core/p2p/agent.go:461\ngithub.com/iotexproject/iotex-core/blocksync.(*blockSyncer).ProcessSyncRequest\n\t/go/apps/iotex-core/blocksync/blocksync.go:317\ngithub.com/iotexproject/iotex-core/chainservice.(*ChainService).HandleSyncRequest\n\t/go/apps/iotex-core/chainservice/chainservice.go:165\ngithub.com/iotexproject/iotex-core/dispatcher.(*IotxDispatcher).handleBlockSyncMsg\n\t/go/apps/iotex-core/dispatcher/dispatcher.go:315\ngithub.com/iotexproject/iotex-core/dispatcher.(*IotxDispatcher).syncHandler\n\t/go/apps/iotex-core/dispatcher/dispatcher.go:249\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1594"}
{"level":"error","ts":"2024-01-26T15:43:17.168Z","caller":"dispatcher/dispatcher.go:316","msg":"Failed to handle sync request.","ioAddr":"io1llzp2lu6xrja9p3xvf2rdrx58z6en8meyr3669","error":"error when sending unicast message: failed to connect the peer: context deadline exceeded","errorVerbose":"context deadline exceeded\nfailed to connect the peer\ngithub.com/iotexproject/go-p2p.(*Host).unicast\n\t/go/pkg/mod/github.com/iotexproject/go-p2p@v0.3.5/p2p.go:596\ngithub.com/iotexproject/go-p2p.(*Host).Unicast\n\t/go/pkg/mod/github.com/iotexproject/go-p2p@v0.3.5/p2p.go:586\ngithub.com/iotexproject/iotex-core/p2p.(*agent).UnicastOutbound\n\t/go/apps/iotex-core/p2p/agent.go:461\ngithub.com/iotexproject/iotex-core/blocksync.(*blockSyncer).ProcessSyncRequest\n\t/go/apps/iotex-core/blocksync/blocksync.go:317\ngithub.com/iotexproject/iotex-core/chainservice.(*ChainService).HandleSyncRequest\n\t/go/apps/iotex-core/chainservice/chainservice.go:165\ngithub.com/iotexproject/iotex-core/dispatcher.(*IotxDispatcher).handleBlockSyncMsg\n\t/go/apps/iotex-core/dispatcher/dispatcher.go:315\ngithub.com/iotexproject/iotex-core/dispatcher.(*IotxDispatcher).syncHandler\n\t/go/apps/iotex-core/dispatcher/dispatcher.go:249\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1594\nerror when sending unicast message\ngithub.com/iotexproject/iotex-core/p2p.(*agent).UnicastOutbound\n\t/go/apps/iotex-core/p2p/agent.go:462\ngithub.com/iotexproject/iotex-core/blocksync.(*blockSyncer).ProcessSyncRequest\n\t/go/apps/iotex-core/blocksync/blocksync.go:317\ngithub.com/iotexproject/iotex-core/chainservice.(*ChainService).HandleSyncRequest\n\t/go/apps/iotex-core/chainservice/chainservice.go:165\ngithub.com/iotexproject/iotex-core/dispatcher.(*IotxDispatcher).handleBlockSyncMsg\n\t/go/apps/iotex-core/dispatcher/dispatcher.go:315\ngithub.com/iotexproject/iotex-core/dispatcher.(*IotxDispatcher).syncHandler\n\t/go/apps/iotex-core/dispatcher/dispatcher.go:249\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1594"}
envestcc commented 4 months ago

In blocksync, there is a timeout config ProcessSyncRequestTTL when sending blocks to other peer. The default is 10s, and this is likely the direct cause of these error logs.