From 3c85d2a4d7285999285700839a6bab3cac2319ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EB=8C=80=ED=9D=AC?= Date: Tue, 10 Feb 2026 18:02:08 +0900 Subject: [PATCH] feature(proxy): Adds special handling for client cancellations in proxy error handler Silences logging for client cancellations during polling to reduce noise in logs. Client-side cancellations are common during long-running operations and should not be treated as errors. --- internal/api/modules/amp/proxy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/api/modules/amp/proxy.go b/internal/api/modules/amp/proxy.go index c460a0d6..b323ae5f 100644 --- a/internal/api/modules/amp/proxy.go +++ b/internal/api/modules/amp/proxy.go @@ -3,6 +3,7 @@ package amp import ( "bytes" "compress/gzip" + "context" "fmt" "io" "net/http" @@ -188,6 +189,10 @@ func createReverseProxy(upstreamURL string, secretSource SecretSource) (*httputi // Error handler for proxy failures proxy.ErrorHandler = func(rw http.ResponseWriter, req *http.Request, err error) { + // Client-side cancellations are common during polling; return 499 without logging + if err == context.Canceled { + return + } log.Errorf("amp upstream proxy error for %s %s: %v", req.Method, req.URL.Path, err) rw.Header().Set("Content-Type", "application/json") rw.WriteHeader(http.StatusBadGateway)