From efd6d07303c4fe227bcbd15692b370d5a51469ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Thu, 17 Feb 2022 16:15:08 +0100 Subject: [PATCH] scyllaclient: timeout, report timeout if ctx.Err() == context.DeadlineExceeded The check against error can be problematic in some cases preventing ErrTimeout to be returned. Relates to scylladb/scylla-enterprise#2083 --- pkg/scyllaclient/timeout.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scyllaclient/timeout.go b/pkg/scyllaclient/timeout.go index 499476dcca..cef9444d42 100644 --- a/pkg/scyllaclient/timeout.go +++ b/pkg/scyllaclient/timeout.go @@ -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) } }()