Skip to content

Commit

Permalink
scyllaclient: timeout, report timeout if ctx.Err() == context.Deadlin…
Browse files Browse the repository at this point in the history
…eExceeded

The check against error can be problematic in some cases preventing ErrTimeout to be returned.

Relates to scylladb/scylla-enterprise#2083
  • Loading branch information
mmatczuk committed Feb 17, 2022
1 parent 6961d24 commit efd6d07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/scyllaclient/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func timeout(next http.RoundTripper, timeout time.Duration) http.RoundTripper {
}
}

if errors.Is(err, context.DeadlineExceeded) && errors.Is(ctx.Err(), context.DeadlineExceeded) {
if ctx.Err() == context.DeadlineExceeded { //nolint: errorlint
err = errors.Wrapf(ErrTimeout, "after %s", d)
}
}()
Expand Down

0 comments on commit efd6d07

Please sign in to comment.