fix(deps): update github.com/grafana/gomemcache digest to 6947259 (main) (#10836)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/grafana/gomemcache](https://togithub.com/grafana/gomemcache)
| require | digest | `70d78ea` -> `6947259` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/grafana/loki).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44LjEiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zMS41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
pull/10473/head^2
renovate[bot] 2 years ago committed by GitHub
parent 1781d7c700
commit 2327789b55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      go.mod
  2. 4
      go.sum
  3. 42
      vendor/github.com/grafana/gomemcache/memcache/memcache.go
  4. 2
      vendor/modules.txt

@ -51,7 +51,7 @@ require (
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
github.com/grafana/dskit v0.0.0-20231017083947-7b512eb54d47
github.com/grafana/go-gelf/v2 v2.0.1
github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1
github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd
github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0

@ -987,8 +987,8 @@ github.com/grafana/go-gelf/v2 v2.0.1 h1:BOChP0h/jLeD+7F9mL7tq10xVkDG15he3T1zHuQa
github.com/grafana/go-gelf/v2 v2.0.1/go.mod h1:lexHie0xzYGwCgiRGcvZ723bSNyNI8ZRD4s0CLobh90=
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85 h1:xLuzPoOzdfNb/RF/IENCw+oLVdZB4G21VPhkHBgwSHY=
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85/go.mod h1:crI9WX6p0IhrqB+DqIUHulRW853PaNFf7o4UprV//3I=
github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1 h1:MLYY2R60/74hfYl5vRRmC2VDo0Yuql1QQ1ig8hnvgSI=
github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586 h1:/of8Z8taCPftShATouOrBVy6GaTTjgQd/VfNiZp/VXQ=
github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe h1:yIXAAbLswn7VNWBIvM71O2QsgfgW9fRXZNR0DXe6pDU=
github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww=

@ -48,7 +48,7 @@ var (
// CompareAndSwap) failed because the condition was not satisfied.
ErrNotStored = errors.New("memcache: item not stored")
// ErrServer means that a server error occurred.
// ErrServerError means that a server error occurred.
ErrServerError = errors.New("memcache: server error")
// ErrNoStats means that no statistics were available.
@ -175,6 +175,14 @@ type Client struct {
// be set to a number higher than your peak parallel requests.
MaxIdleConns int
// WriteBufferSizeBytes specifies the size of the write buffer (in bytes). The buffer
// is allocated for each connection. If <= 0, the default value of 4KB will be used.
WriteBufferSizeBytes int
// ReadBufferSizeBytes specifies the size of the read buffer (in bytes). The buffer
// is allocated for each connection. If <= 0, the default value of 4KB will be used.
ReadBufferSizeBytes int
// recentlyUsedConnsThreshold is the default grace period given to an
// idle connection to consider it "recently used". Recently used connections
// are never closed even if idle.
@ -402,6 +410,11 @@ func (c *Client) dial(addr net.Addr) (net.Conn, error) {
}
func (c *Client) getConn(addr net.Addr) (*conn, error) {
var (
writer *bufio.Writer
reader *bufio.Reader
)
cn, ok := c.getFreeConn(addr)
if ok {
cn.extendDeadline()
@ -411,17 +424,32 @@ func (c *Client) getConn(addr net.Addr) (*conn, error) {
if err != nil {
return nil, err
}
// Init buffered writer.
if c.WriteBufferSizeBytes > 0 {
writer = bufio.NewWriterSize(nc, c.WriteBufferSizeBytes)
} else {
writer = bufio.NewWriter(nc)
}
// Init buffered reader.
if c.ReadBufferSizeBytes > 0 {
reader = bufio.NewReaderSize(nc, c.ReadBufferSizeBytes)
} else {
reader = bufio.NewReader(nc)
}
cn = &conn{
nc: nc,
addr: addr,
rw: bufio.NewReadWriter(bufio.NewReader(nc), bufio.NewWriter(nc)),
rw: bufio.NewReadWriter(reader, writer),
c: c,
}
cn.extendDeadline()
return cn, nil
}
func (c *Client) onItem(item *Item, operation string, fn func(*Client, *bufio.ReadWriter, *Item) error) error {
func (c *Client) onItem(item *Item, fn func(*Client, *bufio.ReadWriter, *Item) error) error {
addr, err := c.selector.PickServer(item.Key)
if err != nil {
return err
@ -706,7 +734,7 @@ func cut(s string, sep byte) (before, after string, found bool) {
// Set writes the given item, unconditionally.
func (c *Client) Set(item *Item) error {
return c.onItem(item, "set", (*Client).set)
return c.onItem(item, (*Client).set)
}
func (c *Client) set(rw *bufio.ReadWriter, item *Item) error {
@ -716,7 +744,7 @@ func (c *Client) set(rw *bufio.ReadWriter, item *Item) error {
// Add writes the given item, if no value already exists for its
// key. ErrNotStored is returned if that condition is not met.
func (c *Client) Add(item *Item) error {
return c.onItem(item, "add", (*Client).add)
return c.onItem(item, (*Client).add)
}
func (c *Client) add(rw *bufio.ReadWriter, item *Item) error {
@ -726,7 +754,7 @@ func (c *Client) add(rw *bufio.ReadWriter, item *Item) error {
// Replace writes the given item, but only if the server *does*
// already hold data for this key
func (c *Client) Replace(item *Item) error {
return c.onItem(item, "replace", (*Client).replace)
return c.onItem(item, (*Client).replace)
}
func (c *Client) replace(rw *bufio.ReadWriter, item *Item) error {
@ -741,7 +769,7 @@ func (c *Client) replace(rw *bufio.ReadWriter, item *Item) error {
// calls. ErrNotStored is returned if the value was evicted in between
// the calls.
func (c *Client) CompareAndSwap(item *Item) error {
return c.onItem(item, "cas", (*Client).cas)
return c.onItem(item, (*Client).cas)
}
func (c *Client) cas(rw *bufio.ReadWriter, item *Item) error {

@ -900,7 +900,7 @@ github.com/grafana/dskit/user
# github.com/grafana/go-gelf/v2 v2.0.1
## explicit; go 1.17
github.com/grafana/go-gelf/v2/gelf
# github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1
# github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586
## explicit; go 1.18
github.com/grafana/gomemcache/memcache
# github.com/grafana/loki/pkg/push v0.0.0-20231023154132-0a7737e7c7eb => ./pkg/push

Loading…
Cancel
Save