Skip to content

Commit 93eba69

Browse files
author
Dmitry Shmulevich
authored
QueryFrontend sets incorrect status code on HTTP timeout (cortexproject#2483)
* QueryFrontend sets incorrect status code on HTTP timeout Signed-off-by: Dmitry Shmulevich <[email protected]> * updated CHANGELOG Signed-off-by: Dmitry Shmulevich <[email protected]> * addressed comments Signed-off-by: Dmitry Shmulevich <[email protected]>
1 parent 3c1a324 commit 93eba69

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* [BUGFIX] Ring: Fixed a situation where upgrading from pre-1.0 cortex with a rolling strategy caused new 1.0 ingesters to lose their zone value in the ring until manually forced to re-register. #2404
4444
* [BUGFIX] Distributor: `/all_user_stats` now show API and Rule Ingest Rate correctly. #2457
4545
* [BUGFIX] Fixed `version`, `revision` and `branch` labels exported by the `cortex_build_info` metric. #2468
46+
* [BUGFIX] QueryFrontend: fixed a situation where HTTP error is ignored and an incorrect status code is set. #2483
4647

4748
## 1.0.0 / 2020-04-02
4849

pkg/querier/frontend/frontend.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ func (f *Frontend) handle(w http.ResponseWriter, r *http.Request) {
185185
hs[h] = vs
186186
}
187187
w.WriteHeader(resp.StatusCode)
188-
io.Copy(w, resp.Body)
188+
189+
if _, err = io.Copy(w, resp.Body); err != nil {
190+
server.WriteError(w, err)
191+
return
192+
}
189193
}
190194

191195
func writeError(w http.ResponseWriter, err error) {

0 commit comments

Comments
 (0)