Skip to content

Commit

Permalink
chore(retrieval): added more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Sep 27, 2023
1 parent de2db79 commit f6b6e4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/retrieval/retrieval.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (s *Service) RetrieveChunk(ctx context.Context, chunkAddr, sourcePeerAddr s
if errors.Is(err, topology.ErrNotFound) {
if skip.PruneExpiresAfter(chunkAddr, overDraftRefresh) == 0 { //no overdraft peers, we have depleted ALL peers
if inflight == 0 {
loggerV1.Debug("no peers left", "chunk_address", chunkAddr, "error", err)
loggerV1.Debug("no peers left", "chunk_address", chunkAddr, "errors_left", errorsLeft, "isOrigin", origin, "error", err)
return nil, err
}
continue // there is still an inflight request, wait for it's result
Expand Down Expand Up @@ -254,7 +254,8 @@ func (s *Service) RetrieveChunk(ctx context.Context, chunkAddr, sourcePeerAddr s
return res.chunk, nil
}

loggerV1.Debug("failed to get chunk", "chunk_address", chunkAddr, "peer_address", res.peer, "error", res.err)
loggerV1.Debug("failed to get chunk", "chunk_address", chunkAddr, "peer_address", res.peer,
"peer_proximity", swarm.Proximity(res.peer.Bytes(), s.addr.Bytes()), "error", res.err)

errorsLeft--
s.errSkip.Add(chunkAddr, res.peer, skiplistDur)
Expand Down

0 comments on commit f6b6e4e

Please sign in to comment.