Skip to content

Commit

Permalink
chore: add target peer id in sync piece trace (dragonflyoss#1278)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma authored Apr 25, 2022
1 parent f9ec2d3 commit 09a34b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/daemon/peer/peertask_piecetask_synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (s *pieceTaskSyncManager) newPieceTaskSynchronizer(
}

_, span := tracer.Start(s.ctx, config.SpanSyncPieceTasks)
span.SetAttributes(config.AttributeTargetPeerID.String(dstPeer.PeerId))
synchronizer := &pieceTaskSynchronizer{
span: span,
peerTaskConductor: s.peerTaskConductor,
Expand Down Expand Up @@ -309,7 +310,7 @@ func (s *pieceTaskSynchronizer) dispatchPieceRequest(piecePacket *base.PiecePack
}
select {
case s.pieceRequestCh <- req:
s.span.AddEvent(fmt.Sprintf("send piece #%d request", piece.PieceNum))
s.span.AddEvent(fmt.Sprintf("send piece #%d request to piece download queue", piece.PieceNum))
case <-s.peerTaskConductor.successCh:
s.Infof("peer task success, stop dispatch piece request, dest peer: %s", s.dstPeer.PeerId)
case <-s.peerTaskConductor.failCh:
Expand Down

0 comments on commit 09a34b3

Please sign in to comment.