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

Proxy: fix response set panic #7484

Merged
merged 1 commit into from
Jun 26, 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
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
Loading