Fix multiple response.WriteHeader calls error in remote read adapter (#5159)

* fix multiple response.WriteHeader calls in remote read adapter
* remove useless return

Signed-off-by: qinng <guoruyi1@xiaomi.com>
This commit is contained in:
qinng 2019-04-10 20:25:35 +08:00 committed by Brian Brazil
parent e5dbac7972
commit cc75c27580

View File

@ -296,8 +296,7 @@ func serve(logger log.Logger, addr string, writers []writer, readers []reader) e
compressed = snappy.Encode(nil, data)
if _, err := w.Write(compressed); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
level.Warn(logger).Log("msg", "Error writing response", "storage", reader.Name(), "err", err)
}
})