Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bitswap/network/httpnet/httpnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,11 @@
continue // retry again ignoring current url
case typeContext:
case typeFatal:
log.Error(err)
// noop. Return result. tryURL
// never returns
// typeFatal. Error logging
// happens in the result
// collector
case typeServer:
u.serverErrors.Add(1)
continue // retry until bestURL forces abort
Expand Down Expand Up @@ -690,7 +694,7 @@
nil,
)
if err != nil {
log.Error(err)
log.Error("error building request:", err)

Check warning on line 697 in bitswap/network/httpnet/httpnet.go

View check run for this annotation

Codecov / codecov/patch

bitswap/network/httpnet/httpnet.go#L697

Added line #L697 was not covered by tests
return nil, err
}

Expand Down
6 changes: 3 additions & 3 deletions bitswap/network/httpnet/msg_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
// server issues, and simply return 404 when they cannot find
// the content but everything else is fine.
err := fmt.Errorf("%q -> %d: %q", req.URL, statusCode, string(body))
log.Error(err)
log.Warn(err)
retryAfter := resp.Header.Get("Retry-After")
cooldownUntil, ok := parseRetryAfter(retryAfter)
if ok { // it means we should retry, so we will retry.
Expand All @@ -391,7 +391,7 @@
// it fails MaxRetries, we will fully disconnect.
default:
err := fmt.Errorf("%q -> %d: %q", req.URL, statusCode, string(body))
log.Error(err)
log.Warn(err)

Check warning on line 394 in bitswap/network/httpnet/msg_sender.go

View check run for this annotation

Codecov / codecov/patch

bitswap/network/httpnet/msg_sender.go#L394

Added line #L394 was not covered by tests
sender.ht.cooldownTracker.setByDuration(req.URL.Host, sender.opts.SendErrorBackoff)
u.cooldown.Store(time.Now().Add(sender.opts.SendErrorBackoff))
return nil, &senderError{
Expand Down Expand Up @@ -522,7 +522,7 @@
// error handling
switch result.err.Type {
case typeFatal:
log.Errorf("fatal error. Disconnecting from %s: %s", sender.peer, result.err.Err)
log.Warnf("disconnecting from %s: %s", sender.peer, result.err.Err)

Check warning on line 525 in bitswap/network/httpnet/msg_sender.go

View check run for this annotation

Codecov / codecov/patch

bitswap/network/httpnet/msg_sender.go#L525

Added line #L525 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 warning is fine for Kubo (default is error) but if folks run their boxes with info i have a gut feeling this may still get annoying once we have a lot of HTTP providers

but we will re-evaluate once Kubo 0.36 ships

sender.ht.DisconnectFrom(ctx, sender.peer)
err = result.err
// continue processing responses as workers
Expand Down
Loading