Skip to content
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 @@ -15,6 +15,7 @@
* [BUGFIX] Compactor: Cleaner would delete bucket index when there is no block in bucket store. #6577
* [BUGFIX] Querier: Fix marshal native histogram with empty bucket when protobuf codec is enabled. #6595
* [BUGFIX] Query Frontend: Fix samples scanned and peak samples query stats when query hits results cache. #6591
* [BUGFIX] Query Frontend: Fix panic caused by nil pointer dereference. #6609

## 1.19.0 in progress

Expand Down
2 changes: 1 addition & 1 deletion pkg/frontend/v2/frontend_scheduler_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func (w *frontendSchedulerWorker) schedulerLoop(loop schedulerpb.SchedulerForFro
req.response <- &frontendv2pb.QueryResultRequest{
HttpResponse: &httpgrpc.HTTPResponse{
Code: http.StatusInternalServerError,
Body: []byte(err.Error()),
Body: []byte(resp.GetError()),
},
}

Expand Down
13 changes: 13 additions & 0 deletions pkg/frontend/v2/frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v2
import (
"context"
"net"
"net/http"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -182,6 +183,18 @@ func TestFrontendEnqueueFailure(t *testing.T) {
require.True(t, strings.Contains(err.Error(), "failed to enqueue request"))
}

func TestFrontendEnqueueInternalError(t *testing.T) {
errorMsg := "Some error"
f, _ := setupFrontend(t, func(f *Frontend, msg *schedulerpb.FrontendToScheduler) *schedulerpb.SchedulerToFrontend {
return &schedulerpb.SchedulerToFrontend{Status: schedulerpb.ERROR, Error: errorMsg}
}, 0)

resp, err := f.RoundTripGRPC(user.InjectOrgID(context.Background(), "test"), &httpgrpc.HTTPRequest{})
require.NoError(t, err)
require.Equal(t, []byte(errorMsg), resp.Body)
require.Equal(t, int32(http.StatusInternalServerError), resp.Code)
}

func TestFrontendCancellation(t *testing.T) {
f, ms := setupFrontend(t, nil, 0)

Expand Down
Loading