Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update to v2
  • Loading branch information
paul1r committed Nov 20, 2024
commit 80dc8979aa469576f6b28ed3832ec3cbb49eff95
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ require (
github.com/richardartoul/molecule v1.0.0
github.com/schollz/progressbar/v3 v3.17.1
github.com/shirou/gopsutil/v4 v4.24.10
github.com/sony/gobreaker v0.5.0
github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97
github.com/twmb/franz-go v1.18.0
github.com/twmb/franz-go/pkg/kadm v1.14.0
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2540,6 +2540,7 @@ 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=
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.

4 changes: 1 addition & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1533,11 +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