Skip to content
Merged
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
12 changes: 12 additions & 0 deletions pkg/querier/frontend/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package frontend
import (
"context"
"flag"
"fmt"
"net/http"
"sync"
"time"
Expand Down Expand Up @@ -202,6 +203,17 @@ func (w *worker) process(ctx context.Context, c Frontend_ProcessClient) error {
}
}

if len(response.Body) >= w.cfg.GRPCClientConfig.MaxSendMsgSize {
errMsg := fmt.Sprintf("the response is larger than the max (%d vs %d)", len(response.Body), w.cfg.GRPCClientConfig.MaxSendMsgSize)

// This makes sure the request is not retried, else a 500 is sent and we retry the large query again.
response = &httpgrpc.HTTPResponse{
Code: http.StatusRequestEntityTooLarge,
Body: []byte(errMsg),
}
level.Error(w.log).Log("msg", "error processing query", "err", errMsg)
}

if err := c.Send(&ProcessResponse{
HttpResponse: response,
}); err != nil {
Expand Down