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

fix(deps): update module github.com/sony/gobreaker to v2 #15036

Merged
merged 2 commits into from
Nov 20, 2024
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ require (
github.com/segmentio/fasthash v1.0.3
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
github.com/sony/gobreaker v0.5.0
github.com/sony/gobreaker/v2 v2.0.0
github.com/spf13/afero v1.11.0
github.com/stretchr/testify v1.9.0
github.com/uber/jaeger-client-go v2.30.0+incompatible
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2540,6 +2540,8 @@ github.com/soniah/gosnmp v1.25.0/go.mod h1:8YvfZxH388NIIw2A+X5z2Oh97VcNhtmxDLt5Q
github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg=
github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
github.com/sony/gobreaker/v2 v2.0.0 h1:23AaR4JQ65y4rz8JWMzgXw2gKOykZ/qfqYunll4OwJ4=
github.com/sony/gobreaker/v2 v2.0.0/go.mod h1:8JnRUz80DJ1/ne8M8v7nmTs2713i58nIt4s7XcGe/DI=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
Expand Down
10 changes: 5 additions & 5 deletions pkg/storage/chunk/cache/memcached_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/sony/gobreaker"
"github.com/sony/gobreaker/v2"

"github.com/grafana/loki/v3/pkg/util/constants"
"github.com/grafana/loki/v3/pkg/util/jumphash"
Expand Down Expand Up @@ -50,7 +50,7 @@ type memcachedClient struct {
addresses []string
provider *dns.Provider

cbs map[ /*address*/ string]*gobreaker.CircuitBreaker
cbs map[string]*gobreaker.CircuitBreaker[interface{}]
cbFailures uint
cbTimeout time.Duration
cbInterval time.Duration
Expand Down Expand Up @@ -152,7 +152,7 @@ func NewMemcachedClient(cfg MemcachedClientConfig, name string, r prometheus.Reg
service: cfg.Service,
logger: logger,
provider: dns.NewProvider(logger, dnsProviderRegisterer, dns.GolangResolverType),
cbs: make(map[string]*gobreaker.CircuitBreaker),
cbs: make(map[string]*gobreaker.CircuitBreaker[interface{}]),
cbFailures: cfg.CBFailures,
cbInterval: cfg.CBInterval,
cbTimeout: cfg.CBTimeout,
Expand Down Expand Up @@ -201,7 +201,7 @@ func (c *memcachedClient) dialViaCircuitBreaker(network, address string, timeout
c.Lock()
cb := c.cbs[address]
if cb == nil {
cb = gobreaker.NewCircuitBreaker(gobreaker.Settings{
cb = gobreaker.NewCircuitBreaker[interface{}](gobreaker.Settings{
Name: c.name + ":" + address,
Interval: c.cbInterval,
Timeout: c.cbTimeout,
Expand Down Expand Up @@ -295,7 +295,7 @@ func (c *memcachedClient) updateMemcacheServers() error {
// Copy across circuit-breakers for current set of addresses, thus
// leaving behind any for servers we won't talk to again
c.Lock()
newCBs := make(map[string]*gobreaker.CircuitBreaker, len(servers))
newCBs := make(map[string]*gobreaker.CircuitBreaker[interface{}], len(servers))
for _, address := range servers {
if cb, exists := c.cbs[address]; exists {
newCBs[address] = cb
Expand Down
132 changes: 0 additions & 132 deletions vendor/github.com/sony/gobreaker/README.md

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1533,9 +1533,9 @@ github.com/shurcooL/vfsgen
# github.com/sirupsen/logrus v1.9.3
## explicit; go 1.13
github.com/sirupsen/logrus
# github.com/sony/gobreaker v0.5.0
## explicit; go 1.12
github.com/sony/gobreaker
# github.com/sony/gobreaker/v2 v2.0.0
## explicit; go 1.21
github.com/sony/gobreaker/v2
# github.com/spaolacci/murmur3 v1.1.0
## explicit
github.com/spaolacci/murmur3
Expand Down
Loading