diff --git a/CHANGELOG.md b/CHANGELOG.md index 875efa359d5..fce64020deb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ * [ENHANCEMENT] Add support for IPv6 [#1555](https://github.com/grafana/tempo/pull/1555) (@zalegrala) * [ENHANCEMENT] Add span filtering to spanmetrics processor [#2274](https://github.com/grafana/tempo/pull/2274) (@zalegrala) * [BUGFIX] tempodb integer divide by zero error [#2167](https://github.com/grafana/tempo/issues/2167) (@kroksys) -* [CHANGE] **Breaking Change** Rename s3.insecure_skip_verify [#???](https://github.com/grafana/tempo/pull/???) (@zalegrala) +* [CHANGE] **Breaking Change** Rename s3.insecure_skip_verify [#2407](https://github.com/grafana/tempo/pull/2407) (@zalegrala) ```yaml storage: trace: @@ -37,6 +37,7 @@ storage: insecure_skip_verify: true // renamed to tls_insecure_skip_verify ``` +* [CHANGE] Ignore context canceled errors in the queriers [#2440](https://github.com/grafana/tempo/pull/2440) (@joe-elliott) ## v2.1.1 / 2023-04-28 * [BUGFIX] Fix issue where Tempo sometimes flips booleans from false->true at storage time. [#2400](https://github.com/grafana/tempo/issues/2400) (@joe-elliott) diff --git a/modules/querier/http.go b/modules/querier/http.go index dc0ff95b721..9a42a1ede7a 100644 --- a/modules/querier/http.go +++ b/modules/querier/http.go @@ -2,6 +2,7 @@ package querier import ( "context" + "errors" "fmt" "net/http" "time" @@ -60,7 +61,7 @@ func (q *Querier) TraceByIDHandler(w http.ResponseWriter, r *http.Request) { QueryMode: queryMode, }, timeStart, timeEnd) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + handleError(w, err) return } @@ -121,7 +122,7 @@ func (q *Querier) SearchHandler(w http.ResponseWriter, r *http.Request) { resp, err = q.SearchRecent(ctx, req) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + handleError(w, err) return } } else { @@ -135,7 +136,7 @@ func (q *Querier) SearchHandler(w http.ResponseWriter, r *http.Request) { resp, err = q.SearchBlock(ctx, req) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + handleError(w, err) return } } @@ -165,7 +166,7 @@ func (q *Querier) SearchTagsHandler(w http.ResponseWriter, r *http.Request) { resp, err := q.SearchTags(ctx, req) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + handleError(w, err) return } @@ -194,7 +195,7 @@ func (q *Querier) SearchTagsV2Handler(w http.ResponseWriter, r *http.Request) { resp, err := q.SearchTagsV2(ctx, req) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + handleError(w, err) return } @@ -223,7 +224,7 @@ func (q *Querier) SearchTagValuesHandler(w http.ResponseWriter, r *http.Request) resp, err := q.SearchTagValues(ctx, req) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + handleError(w, err) return } @@ -252,7 +253,7 @@ func (q *Querier) SearchTagValuesV2Handler(w http.ResponseWriter, r *http.Reques resp, err := q.SearchTagValuesV2(ctx, req) if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) + handleError(w, err) return } @@ -264,3 +265,11 @@ func (q *Querier) SearchTagValuesV2Handler(w http.ResponseWriter, r *http.Reques } w.Header().Set(api.HeaderContentType, api.HeaderAcceptJSON) } + +func handleError(w http.ResponseWriter, err error) { + if errors.Is(err, context.Canceled) { + // ignore this error. we regularly cancel context once queries are complete + return + } + http.Error(w, err.Error(), http.StatusInternalServerError) +}