From 09af6c262c935f5d92f5e7afdbc5866cce446844 Mon Sep 17 00:00:00 2001 From: Nityananda Gohain Date: Mon, 26 Dec 2022 15:29:49 +0530 Subject: [PATCH] fix: proxy_read_timeout updated in nginx conf (#1885) * fix: proxy_read_timeout updated in nginx conf * fix: live tail endpoint-flush the headers first Co-authored-by: Prashant Shahi Co-authored-by: Ankit Nayan --- deploy/docker-swarm/common/nginx-config.conf | 2 ++ deploy/docker/common/nginx-config.conf | 2 ++ pkg/query-service/app/http_handler.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/deploy/docker-swarm/common/nginx-config.conf b/deploy/docker-swarm/common/nginx-config.conf index 738805f89f46..a8673496a2ed 100644 --- a/deploy/docker-swarm/common/nginx-config.conf +++ b/deploy/docker-swarm/common/nginx-config.conf @@ -30,6 +30,8 @@ server { location /api { proxy_pass http://query-service:8080/api; + # connection will be closed if no data is read for 600s between successive read operations + proxy_read_timeout 600s; } # redirect server error pages to the static page /50x.html diff --git a/deploy/docker/common/nginx-config.conf b/deploy/docker/common/nginx-config.conf index 738805f89f46..a8673496a2ed 100644 --- a/deploy/docker/common/nginx-config.conf +++ b/deploy/docker/common/nginx-config.conf @@ -30,6 +30,8 @@ server { location /api { proxy_pass http://query-service:8080/api; + # connection will be closed if no data is read for 600s between successive read operations + proxy_read_timeout 600s; } # redirect server error pages to the static page /50x.html diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go index 1dc342390e7f..cb1ef91dff00 100644 --- a/pkg/query-service/app/http_handler.go +++ b/pkg/query-service/app/http_handler.go @@ -2190,6 +2190,8 @@ func (aH *APIHandler) tailLogs(w http.ResponseWriter, r *http.Request) { RespondError(w, &err, "streaming is not supported") return } + // flush the headers + flusher.Flush() for { select {