Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Fix error metric on timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baliedge committed Sep 29, 2023
1 parent 831e4cf commit 2c93a90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3
github.com/hashicorp/memberlist v0.5.0
github.com/mailgun/errors v0.1.5
github.com/mailgun/holster/v4 v4.14.2
github.com/miekg/dns v1.1.50
github.com/pkg/errors v0.9.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailgun/errors v0.1.5 h1:riRpZqfUKTdc8saXvoEg2tYkbRyZESU1KvQ3UxPbdus=
github.com/mailgun/errors v0.1.5/go.mod h1:lw+Nh4r/aoUTz6uK915FdfZJo3yq60gPiflFHNpK4NQ=
github.com/mailgun/holster/v4 v4.14.2 h1:wBS+IufPnQM8EBgQtLf7ywuUmmAnaEdRujul/l7xWY4=
github.com/mailgun/holster/v4 v4.14.2/go.mod h1:0Gc8+xqL3ElCsceOt7ySj1J3j9s3WLBJaV07yeE61y4=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down
13 changes: 2 additions & 11 deletions gubernator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"sync"
"sync/atomic"

"github.com/mailgun/errors"
"github.com/mailgun/holster/v4/ctxutil"
"github.com/mailgun/holster/v4/errors"
"github.com/mailgun/holster/v4/setter"
"github.com/mailgun/holster/v4/syncutil"
"github.com/mailgun/holster/v4/tracing"
Expand Down Expand Up @@ -763,14 +763,5 @@ func countError(err error, defaultType string) {
}

func isDeadlineExceeded(err error) bool {
for {
if err == nil {
return false
}
if errors.Is(err, context.DeadlineExceeded) {
return true
}

err = errors.Unwrap(err)
}
return errors.As(err, context.DeadlineExceeded)
}

0 comments on commit 2c93a90

Please sign in to comment.