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

Commit df45335

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 df45335

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ We use the following categories for changes:
1616

1717
### Fixed
1818
- Register `promscale_ingest_channel_len_bucket` metric and make it a gauge
19+
- Log warning when failing to write response to remote read requests
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)