Skip to content

Commit c00ce7d

Browse files
yxqvipwzw
yxq
authored andcommitted
fix: mustFetchChunk context
1 parent 73785c6 commit c00ce7d

File tree

1 file changed

+4
-2
lines changed
  • system/p2p/dht/protocol/p2pstore

1 file changed

+4
-2
lines changed

system/p2p/dht/protocol/p2pstore/query.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ func (p *Protocol) mustFetchChunk(req *types.ChunkInfoMsg) (*types.BlockBodys, p
473473
}
474474
}
475475

476+
log.Error("mustFetchChunk from rt peer not found", "chunk hash", chunkHash, "start", req.Start, "error", types2.ErrNotFound)
477+
476478
// 其次从未建立连接但已保存ip等信息的的节点上获取数据
477479
Loop2:
478480
for {
@@ -506,9 +508,9 @@ func (p *Protocol) mustFetchChunk(req *types.ChunkInfoMsg) (*types.BlockBodys, p
506508
log.Error("mustFetchChunk not found", "chunk hash", chunkHash, "start", req.Start, "error", types2.ErrNotFound)
507509

508510
//如果是分片节点没有在分片网络中找到数据,最后到全节点去请求数据
509-
ctx, cancel2 := context.WithTimeout(p.Ctx, time.Minute)
511+
ctx2, cancel2 := context.WithTimeout(p.Ctx, time.Minute)
510512
defer cancel2()
511-
peerInfos, err := p.Discovery.FindPeers(ctx, fullNode)
513+
peerInfos, err := p.Discovery.FindPeers(ctx2, fullNode)
512514
if err != nil {
513515
log.Error("mustFetchChunk", "Find full peers error", err)
514516
return nil, "", types2.ErrNotFound

0 commit comments

Comments
 (0)