Skip to content

Commit 7fcce86

Browse files
authored
Stop using the gomemcache fork (#5801)
Signed-off-by: Alan Protasio <[email protected]>
1 parent 3cf9380 commit 7fcce86

File tree

7 files changed

+119
-29
lines changed

7 files changed

+119
-29
lines changed

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/alicebob/miniredis/v2 v2.30.4
99
github.com/armon/go-metrics v0.4.1
1010
github.com/aws/aws-sdk-go v1.50.25
11-
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
11+
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874
1212
github.com/cespare/xxhash v1.1.0
1313
github.com/cortexproject/promqlsmith v0.0.0-20240115062247-9ed0dfba956d
1414
github.com/dustin/go-humanize v1.0.1
@@ -250,9 +250,6 @@ replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110
250250
// Use fork of gocql that has gokit logs and Prometheus metrics.
251251
replace github.com/gocql/gocql => github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85
252252

253-
// Using a 3rd-party branch for custom dialer - see https://github.com/bradfitz/gomemcache/pull/86
254-
replace github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab
255-
256253
// Replace memberlist with Grafana's fork which includes some fixes that haven't been merged upstream yet
257254
replace github.com/hashicorp/memberlist => github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe
258255

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM
647647
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
648648
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
649649
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
650+
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 h1:N7oVaKyGp8bttX0bfZGmcGkjz7DLQXhAn3DNd3T0ous=
651+
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874/go.mod h1:r5xuitiExdLAJ09PR7vBVENGvp4ZuTBeWTGtxuX3K+c=
650652
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
651653
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
652654
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -1403,8 +1405,6 @@ github.com/thanos-io/promql-engine v0.0.0-20240125175542-4a8e9731acba h1:BFohBPq
14031405
github.com/thanos-io/promql-engine v0.0.0-20240125175542-4a8e9731acba/go.mod h1:YGk7VqhYDfhUyZjWK7ZU1JmBQKSvr5mT5Txut8oK1MA=
14041406
github.com/thanos-io/thanos v0.34.2-0.20240226184600-e7cd6c1c60fb h1:/kpKf+GpBGcA0/+HmBF2VCDJuQYDJaml7JV1/YtDA/U=
14051407
github.com/thanos-io/thanos v0.34.2-0.20240226184600-e7cd6c1c60fb/go.mod h1:bcqHW+37C8GTiwokbUNHClNIS0qb5R4qXfNSvNCGHFU=
1406-
github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab h1:7ZR3hmisBWw77ZpO1/o86g+JV3VKlk3d48jopJxzTjU=
1407-
github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab/go.mod h1:eheTFp954zcWZXCU8d0AT76ftsQOTo4DTqkN/h3k1MY=
14081408
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
14091409
github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
14101410
github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=

pkg/chunk/cache/memcached_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func NewMemcachedClient(cfg MemcachedClientConfig, name string, r prometheus.Reg
141141
}),
142142
}
143143
if cfg.CBFailures > 0 {
144-
newClient.Client.DialTimeout = newClient.dialViaCircuitBreaker
144+
newClient.Client.DialContext = newClient.dialViaCircuitBreaker
145145
}
146146

147147
if len(cfg.Addresses) > 0 {
@@ -163,7 +163,7 @@ func (c *memcachedClient) circuitBreakerStateChange(name string, from gobreaker.
163163
level.Info(c.logger).Log("msg", "circuit-breaker state change", "name", name, "from-state", from, "to-state", to)
164164
}
165165

166-
func (c *memcachedClient) dialViaCircuitBreaker(network, address string, timeout time.Duration) (net.Conn, error) {
166+
func (c *memcachedClient) dialViaCircuitBreaker(_ context.Context, network, address string) (net.Conn, error) {
167167
c.Lock()
168168
cb := c.cbs[address]
169169
if cb == nil {
@@ -181,7 +181,7 @@ func (c *memcachedClient) dialViaCircuitBreaker(network, address string, timeout
181181
c.Unlock()
182182

183183
conn, err := cb.Execute(func() (interface{}, error) {
184-
return net.DialTimeout(network, address, timeout)
184+
return net.DialTimeout(network, address, c.cbTimeout)
185185
})
186186
if err != nil {
187187
return nil, err

vendor/github.com/bradfitz/gomemcache/AUTHORS

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/bradfitz/gomemcache/memcache/memcache.go

Lines changed: 101 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/bradfitz/gomemcache/memcache/selector.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)