yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] proxy_pass: clear backtrace on ECONNREFUSED
@ 2015-04-24 11:11 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-04-24 11:11 UTC (permalink / raw)
  To: yahns-public

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(+)

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
 
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-24 11:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-24 11:11 [PATCH] proxy_pass: clear backtrace on ECONNREFUSED Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/yahns.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).