From 9e3217b0522315d2d115e53309f3563e9554ffc9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 24 Apr 2015 11:07:40 +0000 Subject: proxy_pass: clear backtrace on ECONNREFUSED Bad connections or dead upstreams cannot be solved looking at a backtrace, so avoid polluting logs with them and making other problems less visible. --- lib/yahns/proxy_pass.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb index e86e9c9..7083104 100644 --- a/lib/yahns/proxy_pass.rb +++ b/lib/yahns/proxy_pass.rb @@ -72,6 +72,9 @@ class Yahns::ProxyPass # :nodoc: send_req_buf(req) end rescue => e + # avoid polluting logs with a giant backtrace when the problem isn't + # fixable in code. + e.set_backtrace([]) if Errno::ECONNREFUSED === e c.proxy_err_response(502, self, e, nil) end -- cgit v1.2.3-24-ge0c7