Skip to content

Commit

Permalink
Proxy: fix response set panic (#7484)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
  • Loading branch information
MichaHoffmann authored Jun 26, 2024
1 parent d82b2bd commit 9a96e34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

- [#7326](https://github.com/thanos-io/thanos/pull/7326) Query: fixing exemplars proxy when querying stores with multiple tenants.
- [#7403](https://github.com/thanos-io/thanos/pull/7403) Sidecar: fix startup sequence
- [#7484](https://github.com/thanos-io/thanos/pull/7484) Proxy: fix panic in lazy response set

### Added

Expand Down
13 changes: 3 additions & 10 deletions pkg/store/proxy_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ func newLazyRespSet(
}

resp, err := cl.Recv()

if err != nil {
if err == io.EOF {
l.bufferedResponsesMtx.Lock()
Expand All @@ -362,10 +361,8 @@ func newLazyRespSet(
var rerr error
// If timer is already stopped
if t != nil && !t.Stop() {
if errors.Is(err, context.Canceled) {
// The per-Recv timeout has been reached.
rerr = errors.Wrapf(err, "failed to receive any data in %s from %s", l.frameTimeout, st)
}
<-t.C // Drain the channel if it was already stopped.
rerr = errors.Wrapf(err, "failed to receive any data in %s from %s", l.frameTimeout, st)
} else {
rerr = errors.Wrapf(err, "receive series from %s", st)
}
Expand Down Expand Up @@ -609,7 +606,6 @@ func newEagerRespSet(
}

resp, err := cl.Recv()

if err != nil {
if err == io.EOF {
return false
Expand All @@ -619,10 +615,7 @@ func newEagerRespSet(
// If timer is already stopped
if t != nil && !t.Stop() {
<-t.C // Drain the channel if it was already stopped.
if errors.Is(err, context.Canceled) {
// The per-Recv timeout has been reached.
rerr = errors.Wrapf(err, "failed to receive any data in %s from %s", l.frameTimeout, storeName)
}
rerr = errors.Wrapf(err, "failed to receive any data in %s from %s", l.frameTimeout, storeName)
} else {
rerr = errors.Wrapf(err, "receive series from %s", storeName)
}
Expand Down

0 comments on commit 9a96e34

Please sign in to comment.