Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 7b49f1d

Browse files
committed
Log warning when remote read request is cancelled midway
Previously, we were trying to update the header but that cannot be done in this instance since we are already starting to write the request body. Only valid way of handling these situations is to log the error and finish the request.
1 parent 301d9f6 commit 7b49f1d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ We use the following categories for changes:
1515
## [Unreleased]
1616

1717
### Fixed
18-
- Register `promscale_ingest_channel_len_bucket` metric and make it a gauge
18+
- Register `promscale_ingest_channel_len_bucket` metric and make it a gauge [#1177]
19+
- Log warning when failing to write response to remote read requests [#1180]
1920

2021
## [0.10.0] - 2022-02-17
2122

pkg/api/read.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func Read(config *Config, reader querier.Reader, metrics *Metrics, updateMetrics
8888
compressed = snappy.Encode(nil, data)
8989
if _, err := w.Write(compressed); err != nil {
9090
statusCode = "500"
91-
http.Error(w, err.Error(), http.StatusInternalServerError)
91+
log.Warn("msg", "Error writing HTTP response", "err", err)
9292
return
9393
}
9494
statusCode = "2xx"

0 commit comments

Comments
 (0)