Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(share/availability): don't log error canceled operation #2475

Merged
merged 4 commits into from
Jul 14, 2023
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
5 changes: 3 additions & 2 deletions share/availability/full/availability.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ func (fa *ShareAvailability) SharesAvailable(ctx context.Context, root *share.Ro

_, err := fa.getter.GetEDS(ctx, root)
if err != nil {
if errors.Is(err, context.Canceled) {
renaynay marked this conversation as resolved.
Show resolved Hide resolved
return err
}
Wondertan marked this conversation as resolved.
Show resolved Hide resolved
log.Errorw("availability validation failed", "root", root.String(), "err", err.Error())
var byzantineErr *byzantine.ErrByzantine
if ipldFormat.IsNotFound(err) || errors.Is(err, context.DeadlineExceeded) && !errors.As(err, &byzantineErr) {
return share.ErrNotAvailable
}

return err
}
return err
}
Expand Down
6 changes: 3 additions & 3 deletions share/availability/light/availability.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ func (la *ShareAvailability) SharesAvailable(ctx context.Context, dah *share.Roo
}

if err != nil {
if !errors.Is(err, context.Canceled) {
log.Errorw("availability validation failed", "root", dah.String(), "err", err.Error())
if errors.Is(err, context.Canceled) {
return err
}
log.Errorw("availability validation failed", "root", dah.String(), "err", err.Error())
if ipldFormat.IsNotFound(err) || errors.Is(err, context.DeadlineExceeded) {
return share.ErrNotAvailable
}

return err
}
}
Expand Down
Loading