Skip to content

Commit

Permalink
Proxy: fix response set panic
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaHoffmann committed Jun 25, 2024
1 parent d82b2bd commit 8bc5b03
Showing 1 changed file with 3 additions and 10 deletions.
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 8bc5b03

Please sign in to comment.