From 5c5643749e525a0a86b25f1bd8710f0608a17790 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Thu, 2 Jan 2020 13:58:11 -0500 Subject: [PATCH] i/o timeout is not the same as context.DeadlineExceeded --- internal/metrics/metrics.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index ac28162..01d7e7c 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -109,10 +109,8 @@ func TrackError(direction string, e error) (shouldLog bool) { // shouldLog is a err := ee.Wrap(e, 0) errType := errOther //name := err.TypeName() - if errors.Is(e, context.DeadlineExceeded) { - errType = errIOTimeout - } else if strings.Contains(err.Error(), "i/o timeout") { // hit a read or write deadline - log.Warnln("i/o timeout is not the same as context.DeadlineExceeded") + if strings.Contains(err.Error(), "i/o timeout") { // hit a read or write deadline + //log.Warnln("i/o timeout is not the same as context.DeadlineExceeded") errType = errIOTimeout } else if errors.Is(e, syscall.ECONNRESET) { errType = errConnReset